The nonexistent operator (along = v. == lines)

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Apr 5 05:33:49 AEST 1991


In article <20206 at lanl.gov> jlg at cochiti.lanl.gov (Jim Giles) writes:
> This is one of the problems with confounding two distinct concepts
> into one language feature - people soon begin to believe the two
> concepts are inseparable.  In this case, short-circuiting and 
> logical con/disjunction are distinct concepts that just happen
> to be combined into single operators.

What Jim fails to point out is that short-circuiting is almost entirely
useless with bitwise operators---it could only make a difference if the
first argument had all bits zero, and you can use (a)?(b):0 for that.

Conversely, since you can always implement a non-short-circuit logical
operator as (e.g.) !!(a) & !!(b), there's no reason for the language to
provide any logical operators other than the short-circuit ones.

This is common sense, not ``confounding.''

---Dan



More information about the Comp.lang.c mailing list