Mixin template evaluated to string can convert to string mixin expression implicitly

kenji hara k.hara.pg at gmail.com
Fri Jun 24 09:38:07 PDT 2011


2011/6/25 Cristi Cobzarenco <cristi.cobzarenco at gmail.com>:
> I actually like the fact that mixins are explicit - i.e ugly. When you see
> the word mixin, you know to expect strange things, I would say the same
> arguments that apply to C macros apply in this case as well.

I agree that my proposal is 'just a syntactic sugar' to hide 'mixin'
keyword and parentheses.
But, a template instantiation 'TemplateName!(args)' is always returns
something determined in compile time - symbols, constant values,
functions - and implicit string mixin add to them 'generated code'.

And this feature does not change semantics of current string mixin expression.
The generated code by 'TemplateName!(args)' should be 'complete expression'.

Kenji


More information about the Digitalmars-d mailing list