Is the world coming to an end?

Nick Sabalausky a at a.a
Sun Apr 3 01:20:51 PDT 2011


"Michel Fortin" <michel.fortin at michelf.com> wrote in message 
news:in8f9e$1h45$1 at digitalmars.com...
> On 2011-04-02 19:58:25 -0400, Walter Bright <newshound2 at digitalmars.com> 
> said:
>
>> On 4/2/2011 4:11 PM, Michel Fortin wrote:
>>> It's funny that D (the language) has binary notation built-in (which C 
>>> doesn't
>>> have) but no octal notation anymore (which C has).
>>
>> The problem with the octal literals is, as has been often complained 
>> about, people getting surprised by it. I've never heard of anyone being 
>> surprised by the binary or hex literals.
>
> Indeed. Isn't that a good argument for implementing octal literals the 
> same way as binary and hex literals?
>

Octal is never really needed or used for anything but unix file permissions, 
so I really don't think it matters at all if it happens to be inconsistent.

>>
>> I think it's a feature, not a "resort", that library templates can do 
>> this well. I think it's far better than C++0x's user defined literals, 
>> for example.
>
> I disagree that it's better. With C++ user defined literals the user 
> doesn't have to find by himself whether the number fits within the range 
> of a regular integer literal and if not fall back to using a string as the 
> template argument instead.
>

C++'s user defined literals sound like a lexing nightmare to me.





More information about the Digitalmars-d mailing list