[net.lang.c] Additions to C

dgk@ulysses.UUCP (David Korn) (06/14/86)

There is one simple addition to the C language that I would like to see and
that would have been very helpful in some cases.  I would like to allow
a binary operator ?: with the following semantics:

E1 ?: E2 is equivalent to E1?E1:E2 except that E1 is not evaluated a
second time.

Note that E1 || E2 is similar but it only yields logical values.

Note that there are other operators that are like this already.
For example,

E1 += E2 is equivalent to E1 = E1 + E2 except that E1 is not evaluated
a second time.

I don't object to ?: being :?  (=+ became +=) but I think that this
change would be useful.

David Korn
ulysses!dgk