bearophile wrote:
Nick Sabalausky:
Disagree. Octal can often useful on low-level embedded stuff.

I think the point was to improve the syntax of octal numbers, not to remove 
them. So 0125 becomes a syntax error (as usual to keep compatibility with C, 
otherwise it's better to make it just mean 125), and invent a less error-prone 
syntax for octal numbers. For example 0oxxxx.

Exactly. I just think it's ridiculous that octal has a privileged syntax:
int a = 06;
int b = 09;
either both lines should compile, or neither.
I like the 0c635 syntax.

* the comma operator (allow in selected places, eg for(; ;++a, ++b)).
What is the problem with these?

Generally the comma operator is useful only in particular situations, and in 
other situations it may lead to errors.

This is an acceptable use (but this too may lead to some errors):
for( i = 0, j = MAX; i <= j; ++i, --j )

This shows some of the stupid uses of the comma operator:
http://stackoverflow.com/questions/54142/c-comma-operator

A way to use the comma operator is to allow multiple simultaneous assignments:
x, y = y, x
a, b, c = c, b, a
Etc.
(The compiler can minimize the operations and intermediate memory required to 
do that).

That would be useful, but it's not the comma operator.

Bye,
bearophile

Reply via email to