enum strings in import

Nick Treleaven nick at geany.org
Wed May 4 14:33:44 UTC 2022


On Tuesday, 3 May 2022 at 17:41:55 UTC, Anonymouse wrote:
> On Monday, 2 May 2022 at 12:03:20 UTC, Quirin Schroll wrote:
>> The simplest solution is to allow `mixin(expression)` not only 
>> to generate declarations, expressions and statements, but also 
>> to generate identifiers.
>
> `mixin("someInt") = 5` works today,

That is because the left hand side is an expression. There are 
many cases where an identifier is expected but a string mixin is 
not supported, particularly in declarations. I think when people 
learn about string mixins they assume they will work everywhere, 
then run into errors.


More information about the Digitalmars-d mailing list