String Interpolation

Imperatorn johan_forsberg_86 at hotmail.com
Sat Oct 21 21:11:43 UTC 2023


On Saturday, 21 October 2023 at 20:58:44 UTC, duckchess wrote:
> On Saturday, 21 October 2023 at 18:25:22 UTC, Adam D Ruppe 
> wrote:
>> On Saturday, 21 October 2023 at 15:59:06 UTC, duckchess wrote:
>>> can we just lower ```___""``` into ```mixin(___!"")```, where 
>>> ```___``` can be any template name. this way you can 
>>> implement whatever interpolation method you want in a library.
>>
>> https://github.com/adamdruppe/interpolation-examples/blob/master/01-basics.d
>>
>> I'll add more examples to that repo as I have time, but this 
>> implementation allows libraries to do whatever methods they 
>> want.
>
> here's a better example of what i suggest:
>
> https://run.dlang.io/is/n121Ph

Agreed. We need a better/simpler way to get the string from the 
expression without special syntax.

Like basically all other languages


More information about the Digitalmars-d mailing list