Is the world coming to an end?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Apr 3 09:14:16 PDT 2011


On 4/3/11 3:46 AM, Russel Winder wrote:
> On Sun, 2011-04-03 at 04:05 -0400, Nick Sabalausky wrote:
> [ . . . ]
>>> The same goes for 0b... 0x... so why aren't they being removed in favour
>>> of library based solution?
>>
>> Because unlike the octal syntax, those are neither error-prone nor
>> barely-useful. I agree that consistency is good, but I think it's far
>> outweighed in this case by those other concerns.
>
> Your argument rests on the octal representation being like 0777, a
> notation that everyone has already agreed needs removing.  The
> introduction of 0o777 for octal increases consistency without
> introducing error proneness.  This is just win--win.

It wins consistency with two other hardwired conventions for 
representing numbers. It is a total loss in helping anything but octal 
constants.

> There is no consistent language design argument that supports have 0b...
> and 0x... but not 0o... -- requiring the use of octal! from the library
> when hex! and binary! are not the standard forms.

0x is too widespread and too often used in C and C++ to gratuitously 
eliminate it. It does not have significant disadvantages. Besides it is 
used fairly often. I agree that 0b could and should be deprecated.

> In the end this is Walter's decision, I'd just prefer him not to get it
> wrong.

That is appreciated.


Andrei



More information about the Digitalmars-d mailing list