[dmd-beta] Migration path for enum Endian?

Jonathan M Davis jmdavisProg at gmx.com
Tue Sep 6 14:52:00 PDT 2011


On Tuesday, September 06, 2011 17:03:30 Nick Sabalausky wrote:
> The names inside std.system.Endian were changed from UpperCamelCase to
> lowerCamelCase, which makes sense, but maybe the old names should still
> exist for migration?

Yu can't rename enum values without breaking code. Any final switches would be 
broken if you left in the old values as would anything using 
std.traits.EnumMembers. A simple renaming is caught and pointed out quite well 
by the compiler's spellchecker. So, it's simply a matter of renaming any uses 
of the enum values. No, it's not ideal, but there is no migration path which 
avoids immediately breaking code when it comes to renaming enum values. That's 
why I brought it up in the newsgroup previously, and no one said anything 
about preferring that the names of enum values not be fixed in Phobos in order 
to avoid code breakage. Fortunately, the uses of std.system.Endian should be 
fairly rare. Obviously, some code could use it quite extensively, but most 
code doesn't care about endianness, and most of the code that does, should be 
using version blocks for that anyway.

- Jonathan M Davis


More information about the dmd-beta mailing list