Octal literals: who uses this?

Jarrett Billingsley jarrett.billingsley at gmail.com
Sat Mar 14 08:16:51 PDT 2009


On Sat, Mar 14, 2009 at 9:13 AM, Christopher Wright <dhasenan at gmail.com> wrote:
> I've been looking at dil and lexing D. Lexing character literals and string
> literals is not quite so easy as I thought it would be, but overall not
> difficult either.
>
> One thing I'm curious about:
> There are three forms of hex literals:
> \x: 2 digits
> \u: 4 digits
> \U: 8 digits
>
> There is one form of octal literal:
> \: 1 to 3 digits
>
> Why? With hex literals, each option is a fixed width. That is sensible.
>
> Octal literals aren't necessary with hex literals, but they might be
> convenient. However, making them variable width seems like it opens up the
> possibility for obscure bugs. I would not recommend that anyone use octal
> literals, and I don't think they're an advantage to the language. Even if
> they were, their current representation is not.

People use octal?

Agreed.



More information about the Digitalmars-d mailing list