Support of _ placeholder in string interpolation

It would be good to be able to do something like this

List("hello").map(s"$_")

You can try to implement it in scala/scala :smile:.

See scala/bug#7715 and the discussion at scala/scala#2793: this was actually implemented and rejected as being a bit too confusing. And maybe too easy to abuse.

However it was accepted in pattern matching, for the other use of _, so there is that. Still, I’m a bit sad about this one. It’d be really neat for simple use cases…

3 Likes