Some Thoughts On String Interpolation [l10n, restricting access, AA]
JN
666total at wp.pl
Thu Nov 2 00:21:52 UTC 2023
On Thursday, 26 October 2023 at 11:18:46 UTC, kdevel wrote:
> **Accessing Elements Of An AA**
>
> ```d
> string[string] aa;
> aa["name"] = "value";
> writeln (i"The name in s is $(aa[\"name\"])"
> ```
>
I always thought string interpolation is literally some basic
syntax sugar, like:
string s = "$foo ${bar+1}";
would be lowered to:
string s = foo.to!string ~ " " ~ (bar+1).to!string;
I guess it would get problematic when people want to use strings
other than the built-in one though.
More information about the Digitalmars-d
mailing list