Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.lang.c Subject: Re: ambiguous ? Message-ID: <1989Oct25.090802.19444@gdt.bath.ac.uk> Date: 25 Oct 89 09:08:02 GMT References: <11388@smoke.BRL.MIL> <14110@lanl.gov> Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 23 In article <14110@lanl.gov> jlg@lanl.gov (Jim Giles) writes: > >I have still not made my point, but I'm close. Of course the short >circuit nature of these operators is valuable. If they didn't >short circuit, you would still need a way of providing that functionality. Valuable indeed. One of the more common subtle bugs in PL/1 programs is if ((ptr ^= null()) & (ptr->thing ^= value)) because PL/1 logical ops don't short circuit. Algol may have this right, they offer two sets of logical operators: AND and OR which do not short circuit; and ANDTHEN and ORELSE which do. This gives the programmer total control, and might be worth considering for some future version of C or a C offspring. Both are useful, and making either from the other in a language which only supports one is fiddly at best. -- Paul Smee | JANET: Smee@uk.ac.bristol Computer Centre | BITNET: Smee%uk.ac.bristol@ukacrl.bitnet University of Bristol | Internet: Smee%uk.ac.bristol@nsfnet-relay.ac.uk (Phone: +44 272 303132) | UUCP: ...!mcvax!ukc!gdr.bath.ac.uk!exspes