Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Feb 4 17:00:43 UTC 2021


On Thursday, 4 February 2021 at 15:34:07 UTC, Adam D. Ruppe wrote:
> but you don't know that the opening brace is interpolating.
>
> enum name = "foo";
> mixin(iq{ void {name}() {bar} });
>
>
> Is {bar} interpolation or a function body?

It would be interpolation. If you are in text (string) mode when 
hitting "{" it would be taken as opening an expression that 
should be converted to string. So, no ambiguity.




More information about the Digitalmars-d mailing list