Closed segiddins closed 7 years ago
100% down for this.
The question of syntax...
I'm thinking maybe bash-style, where you can do a simple variable substitution with a $
, or a complex expression in $()
let a = 10
let s = "a: $a, a+1: $(a+1)"
Or just take Swift's, which I'm also absolutely cool with.
My only issue with allowing "$foo"
to interpolate foo
is that it doesn't necessarily pass visually as a substitution, especially without syntax highlighting (balanced delimiters are really really cool)
Yeah I think you're right. Then the question becomes if we use $()
or \()
I think if that's the option, I prefer \()
because my eyes scan it as an escape sequence.
String interpolation is implemented as of #52 !
Probably the biggest challenge will be in the lexer, but this would be very cool