Tagged Questions
1
vote
1answer
40 views
Scala unbound placeholder parameter
I am using the following code to meet my needs:
(1 to 5)..map(i => s"\\x${i}") // Produces List("\\x1", "\\x2", "\\x3", "\\x4", "\\x5")
But I would like to use a placeholder. According to the ...
8
votes
1answer
247 views
String interpolation and macro: how to get the StringContext and expression locations
I'm trying to implement a custom string interpolation method with a macro and I need some guidance on using the API.
Here is what I want to do:
/** expected
* LocatedPieces(List(("\nHello ", ...
1
vote
1answer
84 views
looping within scala's string interpolation
This is a bit of an obscure question, but what would be the best way to loop within Scala's string interpolation? For instance, if you wanted to do this
html"""<ul>
${
for (todoItem ...
1
vote
3answers
213 views
Get argument names in String Interpolation in Scala 2.10
As of scala 2.10, the following interpolation is possible.
val name = "someName"
val interpolated = s"Hello world, my name is $name"
Now it is also possible defining custom string interpolations, ...
6
votes
1answer
314 views
Is this a bug in Scala 2.10 String Interpolation inside a multiline String with backslash?
Using Scala 2.10.0-RC1, I tried to use String Interpolation inside a Windows file path, e.g. like this:
val path = s"""c:\foo\bar\$fileName.csv"""
And got an Exception
...
14
votes
4answers
653 views
String interpolation in Scala 2.10 - How to interpolate a String variable?
String interpolation is available in Scala starting Scala 2.10
This is the basic example
val name = "World" //> name : String = World
val message = s"Hello $name" //> message ...