string interpolation

19 views
Skip to first unread message

scott clasen

unread,
Aug 12, 2013, 4:11:46 PM8/12/13
to treehugg...@googlegroups.com
Is there a treehugger construct to generate a string interpolation?

Something like, 

given 

case class Foo(bar:String)

generate

def format(f:Foo) = s"ohai ${foo.bar}"

Eugene Yokota

unread,
Aug 13, 2013, 3:40:03 PM8/13/13
to treehugg...@googlegroups.com
Currently there's no support to generate string interpolation.
I'm guessing people would prefer interpolation part to be structured rather than straight String like:

    INTERP("s", Seq("ohai ", DOLLAR(REF("foo") DOT("bar") APPLY UNIT)))

-eugene

scott clasen

unread,
Aug 13, 2013, 9:17:15 PM8/13/13
to treehugg...@googlegroups.com
Looks great to me!
Reply all
Reply to author
Forward
0 new messages