Interpolation Expression Sequence (IES): Will Delimited Strings Ever Be Supported?

kdevel kdevel at vogtner.de
Fri Aug 16 13:49:58 UTC 2024


On Friday, 16 August 2024 at 12:55:42 UTC, Dejan Lekic wrote:
> iq{} does not work because what is inside is not valid D code.

Valid D code is not required, valid D tokens suffice [2].

```
    auto html = iq{
<!DOCTYPE html>
<html>
    <head>
       <title>$(title)</title>
    </head>
    <body>
};
```

Works (accidentally).

[2] https://dlang.org/spec/lex.html#string_literals "Token 
strings open with the characters q{ and close with the token }. 
In between must be valid D tokens."


More information about the Digitalmars-d mailing list