Just another example of missing string interpolation

Andrea Fontana nospam at example.org
Thu Oct 19 07:29:41 UTC 2023


On Thursday, 19 October 2023 at 01:05:59 UTC, Walter Bright wrote:
> On 10/18/2023 3:43 PM, Andrea Fontana wrote:
>> I am less fond of the proposal related to 
>> printf/writef/writelnf/format/sformat, etc. It appears to add 
>> complexity to the code
>
> Example of the complexity? It's probably the simplest string 
> interpolation I could find.
>
> > introduces unnecessary noise
>
> Example please.

For example:

```
string t = format(i"...."));
            ^^^^^^
```

>
> > is prone to errors

Well, you know, even you posted a wrong example earlier in the 
thread.

I'm also somewhat concerned about potential error messages that 
might confuse users due to the non-obvious abstraction: f.e. what 
happens if someone writes ```myfunction(i"hello $name!");```

Andrea



More information about the Digitalmars-d mailing list