0nnn octal notation considered harmful

2011-02-11 Thread spir
Hello, Just had a strange bug --in a test func!-- caused by this notation. This is due in my case to the practice (common, I guess) of "pretty printing" int numbers using %0nd or %0ns format, to get a nice alignment. Then, if one feeds back results into D code, they are interpreted as octal...

Re: 0nnn octal notation considered harmful

2011-02-11 Thread Jim
spir Wrote: > Hello, > > Just had a strange bug --in a test func!-- caused by this notation. This is > due > in my case to the practice (common, I guess) of "pretty printing" int numbers > using %0nd or %0ns format, to get a nice alignment. Then, if one feeds back > results into D code, they

Re: 0nnn octal notation considered harmful

2011-02-11 Thread Adam Ruppe
We actually have a library replacement for octal literals: http://dpldocs.info/octal But until the C style syntax is disallowed, it doesn't change anything. But, Walter is resistant to the change, last I knew.

Re: 0nnn octal notation considered harmful

2011-02-11 Thread bearophile
spir: > like 0onnn, which is > consistent with common hex & bin notations and cannot lead to > misinterpretation. Such a change would be, I guess, backward compatible; and > would not be misleading for C coders. The 0nnn octal syntax is bug-prone, and not explicit, it's out of place in a lang

Re: 0nnn octal notation considered harmful

2011-02-11 Thread Nick Sabalausky
"spir" wrote in message news:mailman.1504.1297453559.4748.digitalmar...@puremagic.com... > Hello, > > Just had a strange bug --in a test func!-- caused by this notation. This > is due in my case to the practice (common, I guess) of "pretty printing" > int numbers using %0nd or %0ns format, to g

Re: 0nnn octal notation considered harmful

2011-02-11 Thread Tomek Sowiński
spir napisał: > Just had a strange bug --in a test func!-- caused by this notation. This is > due > in my case to the practice (common, I guess) of "pretty printing" int numbers > using %0nd or %0ns format, to get a nice alignment. Then, if one feeds back > results into D code, they are interp

Re: 0nnn octal notation considered harmful

2011-02-11 Thread spir
On 02/11/2011 10:54 PM, Nick Sabalausky wrote: "spir" wrote in message news:mailman.1504.1297453559.4748.digitalmar...@puremagic.com... Hello, Just had a strange bug --in a test func!-- caused by this notation. This is due in my case to the practice (common, I guess) of "pretty printing" int n

Re: 0nnn octal notation considered harmful

2011-02-12 Thread Don
spir wrote: Hello, Just had a strange bug --in a test func!-- caused by this notation. This is due in my case to the practice (common, I guess) of "pretty printing" int numbers using %0nd or %0ns format, to get a nice alignment. Then, if one feeds back results into D code, they are interprete

Re: 0nnn octal notation considered harmful

2011-02-14 Thread Steven Schveighoffer
On Fri, 11 Feb 2011 17:52:34 -0500, Tomek Sowiński wrote: spir napisał: Just had a strange bug --in a test func!-- caused by this notation. This is due in my case to the practice (common, I guess) of "pretty printing" int numbers using %0nd or %0ns format, to get a nice alignment. Then, if

Re: 0nnn octal notation considered harmful

2011-02-16 Thread Stewart Gordon
On 12/02/2011 18:27, Don wrote: spir wrote: Copying a string'ed integer is indeed not the only this notation is bug-prone: prefixing a number with '0' should not change its value (!). Indeed. Even more confusing is that when it's a floating point it doesn't. But see http://d.puremagic.co

Re: 0nnn octal notation considered harmful

2011-02-17 Thread Nick Sabalausky
"Stewart Gordon" wrote in message news:ijgpgb$1apc$1...@digitalmars.com... > > And is [octal] still the form of CompuServe user IDs? > Do those still exist?