Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!husc6!panda!genrad!decvax!decwrl!glacier!hplabs!hao!nbires!rcd From: rcd@nbires.UUCP Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <754@nbires.UUCP> Date: Fri, 9-May-86 01:31:54 EDT Article-I.D.: nbires.754 Posted: Fri May 9 01:31:54 1986 Date-Received: Wed, 14-May-86 01:07:22 EDT References: <838@ihwpt.UUCP> <778@bentley.UUCP> <12329@ucla-cs.ARPA> Organization: NBI,Inc, Boulder CO Lines: 22 > >Btw, you can't have *all* operators extended with "=". How would you write > >"v = v < e;"? (Not that it's useful.) A more precisely stated rule, for C, would be that you can extend any dyadic operator whose result type is the same as the type of the first operand, but... > I think it's useful! As written, of course, it's semantically invalid, > but what you really mean is "v <= e" (sic) or, to demonstrate where it's > really useful, > array[horrendous] [subscript] [list] <= bigexpr; > rather than > if (array[h][s][l] < bigexpr) array[h][s][l] = bigexpr; Cf. Icon, in which the success/failure of a conditional is separate from its value. Icon's <= operator (as all of its relational operators) yields the value of its right operand if it succeeds; otherwise it fails (meaning no result is produced). The semantics described above in ">" is just that of Icon's <:= operator. -- Dick Dunn {hao,ucbvax,allegra}!nbires!rcd (303)444-5710 x3086 ...Cerebus for dictator!