Another silly question

Karl Heuer karl at haddock.ima.isc.com
Sun May 21 08:33:08 AEST 1989


In article <1657 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
>[K&R and the pANS agree that a[i]==i[a],] so further discussion on whether
>they're equivalent in C is pointless - they are, and that's that.  If
>somebody wants to debate whether they *should* be equivalent, they can, but
>they're then talking about D or P, say, not C.

Or maybe ANSI C in a nearby parallel universe.  I thought it strange that
X3J11 outlawed "x+ =1" ("+=" is now a single token), but permitted "i[a]" (on
the grounds that they "saw no reason to forbid it").  Neither construct is
ever used outside the IOCCC, and outlawing "i[a]" would have been a small step
towards making arrays higher-class citizens than they are.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
(To anyone who's itching to say that i[hairy_array_expression] avoids a pair
of parentheses: if you code that way, I spit on your grandmother's shadow.)



More information about the Comp.lang.c mailing list