On 6/5/15 11:52 AM, Dennis Ritchie wrote:
On Friday, 5 June 2015 at 14:31:19 UTC, anonymous wrote:
You messed up the quotes. You might be mistaking backticks for
something special, but they're basically just quotes.
Yes, the sample program really made me think that gravis (backticks) -
is something special...
It's just so I didn't have to escape the quotes :D
Otherwise it looks like this:
return "writefln(\"mode " ~ mode ~ ": %s\", " ~ value ~ ");"
I think we can probably do a compile-time substitution processor like
rust (and other languages, including php and ruby) which just uses the
variable name inside a string with some escape around it. `~var~` is not
very succinct, I like $var better.
-Steve