Implicit enum conversions are a stupid PITA

Nick Sabalausky a at a.a
Thu Mar 25 18:10:09 PDT 2010


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:hogsv9$11u7$1 at digitalmars.com...
>
> One thing is clear, though. 0177 is never going to be a decimal number in 
> D, because it will silently and disastrously break code translated from C.

I'm certainly fine with that, since not breaking ported C code is one of D's 
philosophies.

> The only choice is to support 0177 as octal or make it a syntax error. I'd 
> rather support them.

Supporting it means it will "silently and disastrously break code" from 
anyone who tries to use a leading zero and *isn't* a C guru, and very few 
people these days are (I used C for years without being aware of that octal 
syntax - it's only by dumb luck I didn't try to use a leading zero). 
Granted, it may not be common for someone to try to use leading zeroes, but 
it's a landmine I'd rather not have, even if it is down a less-travelled 
sidestreet, expecially considering it's all for such a trivial benefit 
(which amounts to what, one person who just thinks it looks pretty?)





More information about the Digitalmars-d mailing list