String Interpolation
matheus
matheus at gmail.com
Fri Oct 27 13:00:18 UTC 2023
On Friday, 27 October 2023 at 12:49:24 UTC, jmh530 wrote:
> On Friday, 27 October 2023 at 09:47:15 UTC, Arafel wrote:
>> [snip]
>> Good luck explaining these subtleties to new / casual users.
>
> We can add an error message when assigning to a string that
> tells the user to call `.text` or whatever if they want the
> string.
But imagine that instead of "string" was "auto":
auto greeting = i"Hello, ${name}";
Maybe the user (Newcomer!?) is expecting a string in this "auto"
greeting. The error message will be showed late only when the
string conversion is expected not where was defined.
Matheus.
More information about the Digitalmars-d
mailing list