Re: Octal-like integer literals

2012-02-16 Thread H. S. Teoh
On Fri, Feb 17, 2012 at 05:17:00PM +1100, Daniel Murphy wrote: > I had a look at moving them from deprecated to error, but druntime > uses them extensively in the os headers. I think we need a better > solution than a template in the standard library - you shouldn't need > a dependency on phobos t

Re: Octal-like integer literals

2012-02-16 Thread Daniel Murphy
I had a look at moving them from deprecated to error, but druntime uses them extensively in the os headers. I think we need a better solution than a template in the standard library - you shouldn't need a dependency on phobos to use them, and the compiler shouldn't directly reference anything

Re: Octal-like integer literals

2012-02-16 Thread Walter Bright
On 2/11/2012 10:43 AM, Andrej Mitrovic wrote: $ dmd test.d $ test.d(5): octal literals 0744 are deprecated, use std.conv.octal!744 instead I was inordinately proud of that error message :-)

Re: Octal-like integer literals

2012-02-16 Thread Walter Bright
On 2/11/2012 10:43 AM, Andrej Mitrovic wrote: You can only use them with the -d switch. And 0744 will never be valid D code, for the simple reason that code moved over from C would silently break in awful ways.

Re: Octal-like integer literals

2012-02-11 Thread Timon Gehr
On 02/11/2012 07:05 PM, H. S. Teoh wrote: On Sat, Feb 11, 2012 at 06:48:20PM +0100, Andrej Mitrovic wrote: Octals are going away, the use of them in Phobos have been removed and Walter confirmed this too afaik. So the question is, how will things like "0744" and "098" be interpreted once octal

Re: Octal-like integer literals

2012-02-11 Thread Jonathan M Davis
On Saturday, February 11, 2012 10:05:40 H. S. Teoh wrote: > On Sat, Feb 11, 2012 at 06:48:20PM +0100, Andrej Mitrovic wrote: > > Octals are going away, the use of them in Phobos have been removed and > > Walter confirmed this too afaik. > > So the question is, how will things like "0744" and "098"

Re: Octal-like integer literals

2012-02-11 Thread Andrej Mitrovic
On 2/11/12, H. S. Teoh wrote: > On Sat, Feb 11, 2012 at 06:48:20PM +0100, Andrej Mitrovic wrote: >> Octals are going away, the use of them in Phobos have been removed and >> Walter confirmed this too afaik. > > So the question is, how will things like "0744" and "098" be interpreted > once octals

Re: Octal-like integer literals

2012-02-11 Thread H. S. Teoh
On Sat, Feb 11, 2012 at 06:48:20PM +0100, Andrej Mitrovic wrote: > Octals are going away, the use of them in Phobos have been removed and > Walter confirmed this too afaik. So the question is, how will things like "0744" and "098" be interpreted once octals have gone away? Will they still be rejec

Re: Octal-like integer literals

2012-02-11 Thread Andrej Mitrovic
Octals are going away, the use of them in Phobos have been removed and Walter confirmed this too afaik.

Re: Octal-like integer literals

2012-02-11 Thread H. S. Teoh
On Sat, Feb 11, 2012 at 05:37:17PM +0100, Timon Gehr wrote: > On 02/11/2012 05:00 PM, H. S. Teoh wrote: > >Alright, I'm plodding along slowly with my D lexer, and I'm running into > >an interesting case. According to the spec, int literals that begin with > >'0' are supposed to be octal, with the e

Re: Octal-like integer literals

2012-02-11 Thread Timon Gehr
On 02/11/2012 05:00 PM, H. S. Teoh wrote: Alright, I'm plodding along slowly with my D lexer, and I'm running into an interesting case. According to the spec, int literals that begin with '0' are supposed to be octal, with the exception of "0" itself, which is decimal 0. DecimalInteger is defined

Re: Octal-like integer literals

2012-02-11 Thread Ellery Newcomer
OT: http://d.puremagic.com/issues/show_bug.cgi?id=5132 On 02/11/2012 10:06 AM, Daniel Murphy wrote: interpreted differently is just errors waiting to happen.

Re: Octal-like integer literals

2012-02-11 Thread Daniel Murphy
As an error. Because they're allowed in C/C++/etc having them accepted by D but interpreted differently is just errors waiting to happen. "H. S. Teoh" wrote in message news:mailman.230.1328975949.20196.digitalmar...@puremagic.com... > Alright, I'm plodding along slowly with my D lexer, and I'm

Octal-like integer literals

2012-02-11 Thread H. S. Teoh
Alright, I'm plodding along slowly with my D lexer, and I'm running into an interesting case. According to the spec, int literals that begin with '0' are supposed to be octal, with the exception of "0" itself, which is decimal 0. DecimalInteger is defined to begin with a non-zero digit followed by