Mixin template parameters / mixin template literals

"Luís "Luís
Wed Apr 24 16:44:29 PDT 2013


On Wednesday, 24 April 2013 at 23:04:02 UTC, ixid wrote:
> Is changing the language the right approach to this or would 
> smarter IDEs possibly be a better direction?

A smarter IDE always helps :-)

It might not be worth changing the language for this (or it 
might), but changing the language to have first-class support of 
constructs like this would allow tighter checking of the mixed-in 
code, which seems to me to be mainly the role of the compiler, 
and not of the IDE. For instance, by using token strings, as 
suggested by Tove, you can have a tighter grip on the mixed-in 
string, which should lead to smarter error messages (gramatical 
check), but not as good as first-class support (semantic checks, 
etc).

But I don't think this is only about error checking, it's about 
creating a better abstraction: I think template mixin are a less 
brittle abstraction than string mixins, but without the argument 
type modifiers they can't replace the string mixins. But don't 
take my opinion too seriously, I'm sure you guys know the 
language better than I do :-)


More information about the Digitalmars-d mailing list