String Interpolation

Arafel er.krali at gmail.com
Wed Oct 25 08:00:38 UTC 2023


On 25/10/23 8:49, Walter Bright wrote:
> Thank you. The trouble is with the mixin. It can't be dispensed with.

Well, I know you want to make mixins clearly identifiable, but I would 
suggest some easy sintax for string mixins generated by a template.

For instance, using `!!` (I think it's an unused token):

```d
foo!!(a, 42)
```

would be literally just another way of writing:

```d
mixin(foo!(a,42))
```

and thus anybody could implement:

```d
i!!"Helo ${name}"
```

as a library solution, or even use the existing ones.

You could create mixins that are tighly coupled to the called function, 
or generic ones... it would be the most flexible solution.


More information about the Digitalmars-d mailing list