DIP idea: q{}-inspired block mixins

Jacob Carlborg doob at me.com
Thu Nov 5 12:14:39 UTC 2020


On Thursday, 5 November 2020 at 06:04:47 UTC, Paul Backus wrote:

> This seems like an extremely narrow and special-purpose feature 
> for something that could just as easily be addressed by a more 
> general feature, like string interpolation or quasiquotation.

I fully agree.

> It also shares the same basic weakness as format strings, which 
> is that every time you see (for example) an `op` in the mixin 
> body, you have to look somewhere else in the code to see what 
> it's going to be replaced with. And unlike a `%s` format 
> specifier, there's no easy way to distinguish a replacement 
> token in the mixin body from a normal identifier.

I agree. But that's also how templates behave and I have not 
heard of anyone complaining about that.

--
/Jacob Carlborg


More information about the Digitalmars-d mailing list