Is the world coming to an end?

ulrik.mikaelsson at gmail.com ulrik.mikaelsson at gmail.com
Sat Apr 2 15:27:12 PDT 2011


> 0b and 0x are not "dangerous" so there's no need to remove/deprecate them  
> and

> thus cause breakage of code using them.

> At least 0x is quite common (certainly more common than octal numbers) so  
> it

> makes sense to have this short syntax (IMHO).


As I wrote, I think it's great that 010 != 8 anymore.

I just think that 0o10 would be more consistent with 0x and 0b. Obviously  
the framework is there for parsing the literals, and AFAIK, 0o isn't  
accepted today so no code would be broken.

011 = 11
0b11 = 3
0x11 = 17
0o11 = 9

is much more consistent than

011 = 11
0b11 = 3
0x11 = 17
octal!11 = 9

A D-newbie would probably be able to guess 0o for octal, but hardly octal!.  
octal! breaks the rule of least surprise.

In any case, everything is better than 011 = 9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110402/6609a3db/attachment.html>


More information about the Digitalmars-d mailing list