Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ulysses.UUCP Path: utzoo!watmath!clyde!burl!ulysses!dgk From: dgk@ulysses.UUCP (David Korn) Newsgroups: net.lang.c Subject: Additions to C Message-ID: <1294@ulysses.UUCP> Date: Fri, 13-Jun-86 22:53:35 EDT Article-I.D.: ulysses.1294 Posted: Fri Jun 13 22:53:35 1986 Date-Received: Tue, 17-Jun-86 07:36:30 EDT Distribution: net Organization: AT&T Bell Laboratories, Murray Hill Lines: 20 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