Is the world coming to an end?

Steven Schveighoffer schveiguy at yahoo.com
Mon Apr 4 06:10:45 PDT 2011


On Sun, 03 Apr 2011 07:48:24 -0400, spir <denis.spir at gmail.com> wrote:

> On 04/03/2011 02:52 AM, bearophile wrote:
>> Michel Fortin:
>>
>>> The new syntax is certainly usable, it's just inelegant and hackish.
>>> Its your language, it's your choice, and I'll admit it won't affect me
>>> much.
>>
>> My suggestions for Walter are:
>> - To turn 01 .. 07 too into errors;
>> - to deprecate the octal! Phobos template.
>> - To introduce the 0o leading that works from 0o0 to the uint.max;
>> - To change the new error message, so it suggests to use 0o.
>> - To ask opinions to the community here next time before changing  
>> things in D2/D3 :-)
>
> I'm very surprised of this move -- aside the concrete details. What I  
> point out here is how far sentiments about what is "obvious" or  
> "correct" can be, for a given issue, that most of us considered wrong  
> for the same reason.
>
> When I introduced the topic of octal notation 0nnn beeing bad, I was  
> 100% sure that (if a move was ever made) either octals would be thrown  
> out of D all together for beeing nearly useless, or the syntax would be  
> fixed -- the "obvious" "correct" solution if octals remain. While I new  
> about octal!, this was so hackish and obviously wrong *for me*, that I  
> did not even imagine one second it could become the "official" solution.
> I'm certainly not the only one.
> Questions of detail, sure, but we all know what the details hide ;-)

Octal literals *are* out of the language, it's no longer supported.   
Because of historical reasons, the syntax is disallowed (otherwise, ported  
code from C that used octal notation would be horrifically broken).

The octal template is a separate addition to allow octal in the very few  
places it is needed.

IIRC, you never complained that octal notation is horrible because you  
wanted to *use* octal, it's because you *accidentally* used it.  This  
change fixes your problem, you can't accidentally use the octal literal  
notation.  So why the complaints?

-Steve


More information about the Digitalmars-d mailing list