SIP11: Parametrized interpolators?

74 views
Skip to first unread message

Nick Stanchenko

unread,
Mar 19, 2014, 11:43:47 AM3/19/14
to scala...@googlegroups.com
Hi,

There has been some discussion on palladium-internals (https://groups.google.com/d/msg/palladium-internals/Su4ltpYLrP4/7nP6fcqHadsJ) about parametrized interpolators, as in

implicit class RichStringContext(val sc: StringContext) extends AnyVal {
  def x(a: Int)(args: Any*) = ???
}

x(3)"..."

Personally I initially resented the idea, but it starts to make sense when you have a lot of similar interpolators: consider that there is not much control over the interpolator namespace, e.g. one can’t rename interpolators using imports. So grouping them and providing parameters might help with pollution.

Any opinions?

Kind regards,
Nick
Reply all
Reply to author
Forward
0 new messages