Is the world coming to an end?

Daniel Gibson metalcaedes at gmail.com
Sat Apr 2 17:24:24 PDT 2011


Am 03.04.2011 02:23, schrieb Francisco Almeida:
> Walter Bright Wrote:
> 
>> On 4/2/2011 3:27 PM, ulrik.mikaelsson at gmail.com wrote:
>>> As I wrote, I think it's great that 010 != 8 anymore.
>>
>> 010, etc., will now be errors. They will not be 10 decimal.
>>
>> Also, the literals 00, 01, ..., 07 will still be accepted without complaint. 08, 
>> 09, etc. will of course be errors.
> 
> This doesn't feel right, though. Either you permit leading numbers with leading zeroes to be read as decimals, or you forbid them unless they are 0x... or 0b... .

I agree.

> 
> I am concerned about the choice of relegating a kind of number literal to a library template. Doesn't this needlessly impact performance?

No, it's a template, so it's evaluated at compile-time and doesn't impact
(runtime) performance.

> 
> Granted, the 0123 syntax was error prone and we're all glad it's gone, but aren't there better alternatives such as 0o123 or 0q123, for example?
> 

How often do you use octal numbers?


More information about the Digitalmars-d mailing list