[OT] C# can do all the interpolated strings now

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Dec 13 23:35:40 UTC 2021


On Monday, 13 December 2021 at 16:59:47 UTC, Adam D Ruppe wrote:
> On Monday, 13 December 2021 at 16:40:31 UTC, Ola Fosheim 
> Grøstad wrote:
>> I would prefer something like ```sql"…"```, ```css"…"``` etc.
>
> How would you implement those?

That really depends on what your philosophy is. I've given some 
hints above. What do you want to achieve?

1. better IDE support?

2. total control in metaprogramming for each application?

3. types that are shared between libraries (E.g. multiple 
frameworks using the same sql-literal)

4. solid error messages from the compiler without libraries 
having to go out of their way to provide it?

If you want 1, 3, 4 then you probably should consider using a 
validating grammar in the compiler. If you want 2, then you can 
make it a type like I suggested above.



More information about the Digitalmars-d mailing list