digitalmars.D - \ OctalDigit etc.
- Moritz Warning <moritzwarning _nospam_web.de> Mar 15 2008
- Walter Bright <newshound1 digitalmars.com> Mar 19 2008
- Sean Kelly <sean invisibleduck.org> Mar 19 2008
- bearophile <bearophileHUGS lycos.com> Mar 20 2008
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Mar 20 2008
- BCS <BCS pathlink.com> Mar 20 2008
This was probably discussed before. But I run into a problem when I was checking for missing characters in a long string sequence since some application kept telling me that it was invalid. The point was that \012 is not '\0' '1' '2' but one char '\012'. other representations with hexadecimal numbers have an alphabetical char to indicate smth. special might follow (\xaa). In my case thinking of \0 being the same as single char and in a string was wrong. This is inconsistent and I think many could get wrong as I did. I don't have much hope to get a convenient solution as for hexadecimal representations. But I thought I just post this for others who stumble over the same stone. :/
Mar 15 2008
The way the octal escape sequences work is pretty standard practice. To change it would be to confuse the other half of people who use it :-(
Mar 19 2008
== Quote from Walter Bright (newshound1 digitalmars.com)'s articleThe way the octal escape sequences work is pretty standard practice. To change it would be to confuse the other half of people who use it :-(
The format of octal literals is one of the more harebrained ideas we've inherited from C. I'd love to require an "0o" prefix or something of the sort, but it would cause unnecessary trouble for ported C code. Ah well. Sean
Mar 19 2008
Sean Kelly:The format of octal literals is one of the more harebrained ideas we've inherited from C. I'd love to require an "0o" prefix or something of the sort, but it would cause unnecessary trouble for ported C code. Ah well.
Just fixed in Python 3.0 ;-) Among many other things. But I too can see the situation is different: you usually don't port much code from C to Python. Bye, bearophile
Mar 20 2008
"Walter Bright" <newshound1 digitalmars.com> wrote in message news:frs9ov$2258$1 digitalmars.com...The way the octal escape sequences work is pretty standard practice. To change it would be to confuse the other half of people who use it :-(
People use them?
Mar 20 2008
Jarrett Billingsley wrote:"Walter Bright" <newshound1 digitalmars.com> wrote in message news:frs9ov$2258$1 digitalmars.com...The way the octal escape sequences work is pretty standard practice. To change it would be to confuse the other half of people who use it :-(
People use them?
People is simply plural. Therefor, if there are 2 people who use them, then the statement is correct (but not particularly useful). As to if /enough/ people use them to be worth anything... Also, I expect you (and most anyone) use them regularly because \0 is actual a 1 char octal escape sequence. That still has little bearing on the topic though.
Mar 20 2008









bearophile <bearophileHUGS lycos.com> 