Fixing enum names in Phobos

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Aug 4 09:20:37 PDT 2011


On 8/4/11 10:59 AM, Jonathan M Davis wrote:
> On Thursday 04 August 2011 07:33:55 Andrei Alexandrescu wrote:
>> On 8/4/11 12:16 AM, Jonathan M Davis wrote:
>>> So, does anyone actually have an opinion on this? Should we fix the
>>> names or not?
>>
>> We should probably fix the names. A migration path is to simply keep
>> both names for a year or so and remove documentation for old names. For
>> example:
>>
>> enum Variadic {
>>     no, /// doc
>>     NO = no,
>>     c, /// doc
>>     C = c,
>>     d, /// doc
>>     D = d,
>>     typesafe, /// doc
>>     TYPESAFE = typesafe
>> }
>
> Except that that breaks any code that does something like
> EnumMembers!Variadic. For some enums, that probably wouldn't break anyone's
> code. But you can't know for sure whether anyone is using EnumMembers on a
> particular enum.  It would also change the values of the enums, which could
> also break code, which wouldn't be an issue for some enums, but it might be
> for some (and someone could always have been foolish and relied on their exact
> values).

The values are not changed, but point taken about introspection.

Andrei



More information about the Digitalmars-d mailing list