Frist Draft (in this forum): Enum Parameters

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sat Apr 27 21:41:09 UTC 2024


On 26/04/2024 9:39 PM, Quirin Schroll wrote:
> On Friday, 26 April 2024 at 02:47:18 UTC, Steven Schveighoffer wrote:
>> I have thoughts on reworking interpolation tuples if this got in...
> 
> Please, elaborate. I was somewhat absent from the forums while string 
> interpolation took off. I read the docs, but it seems a lot of regulars 
> like you have a lot more intuition about where interpolation tuples are 
> useful. Not only could I use those ideas in the DIP, I’m honestly 
> intrigued because I can’t imagine how they meaningfully interact.

String interpolation slices and dices the string up into metadata 
arguments and the actual expressions specified by the user.

The meta data arguments should be elevated to template parameters, but 
the expressions must remain runtime.

What makes this tricky is given a sequence of expressions an interleaved 
sub sequence (that may not be odd/even), needs to be elevated but the 
others shouldn't be.

If we can elevate the metadata expressions to templates we can validate 
types and formatting during compilation.


More information about the dip.development mailing list