sharkdp / numbat

A statically typed programming language for scientific computations with first class support for physical dimensions and units
https://numbat.dev
Apache License 2.0
1.25k stars 52 forks source link

Allow strings inside string interpolation #632

Open Goju-Ryu opened 3 weeks ago

Goju-Ryu commented 3 weeks ago

I have noticed that interpolations with strings inside are treated as unterminated interpolations. I have found that I have had to introduce a lot of extra bindings to avoid this when writing functions working with strings. I had the following usecase: "{str_replace(value_str_value_part, ".", "") }".
This currently isn't possible so I had to either introduce a named variable in an already cluttered function or give the static strings variables outside the function to use the names instead of the value directly. Some other common usecases I have had for this feature when working in other languages has been something similar to "{if true then "True" else "False"}".

sharkdp commented 3 weeks ago

If we can make this work without introducing ambiguities, let's do it.