String Interpolation

Imperatorn johan_forsberg_86 at hotmail.com
Wed Oct 25 09:55:13 UTC 2023


On Wednesday, 25 October 2023 at 07:08:06 UTC, Walter Bright 
wrote:
> On 10/21/2023 2:11 PM, Imperatorn wrote:
>> Agreed. We need a better/simpler way to get the string from 
>> the expression without special syntax.
>
> ```
> import std.format;
> alias f = std.format.format;
>
> enum b = "betty";
> pragma(msg, i"hello $b".f);
> ```

I get your point, however, it forces the user to import 
std.format in the entire codebase wherever a function takes or 
returns a string and the user wants to use string interpolation


More information about the Digitalmars-d mailing list