Enums - probably an old subject

monarch_dodra monarchdodra at gmail.com
Fri Nov 22 13:09:33 PST 2013


On Friday, 22 November 2013 at 17:34:09 UTC, Steve Teale wrote:
>
>>
>> Does it make sense?
>> I should be really in D.learn but asked that here in context ;)
>
> Sounds like most of us should be in D Learn on this topic.
>
> I should find the time to write up a case for Andrei's 
> suggestion. I have no problem with the compiler telling me that 
> my code is ambiguous, in fact I depend on it!

The "problem" with this approach though, is that if you import my 
module, and I introduce a new enum in my module, I could *break* 
your code by introducing ambiguity.

Not that it's any different from adding functions in modules, 
that could create ambiguity of course. That said, functions have 
a "tendency" of not actually being ambiguous thanks to the fact 
that they overload on their arguments. enums on the other hand, 
have *no* contextual information to disambiguate.


More information about the Digitalmars-d mailing list