Indentation preserving string interpolation in scala -


I was thinking that there are ways to conserve indentation while string interpolation in Scala. Essentially, I was wondering if I would solve my problem with my own string contact macros, but I want to wait until being official.

This is what I want:

  val x = "line1 \ nline2" val str = s "> $ {x}"   

should evaluate str

  & gt; Line 1 Line 2    

You can write your own interpolars, and you can use standard interpolars You can cinematography with your own Now, I do not know what the terminology behind your example is, so I am not trying.

View my presentation on Scale 2.10 as well, because it contains examples of all the courtesies that you can write / override interpolers start at slide 40 (for now - the presentation will be updated till end of 10.10 ).

Comments