Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!helios!archone!byron From: byron@archone.tamu.edu (Byron Rakitzis) Newsgroups: comp.lang.c Subject: Re: When do you use "if ( a = b )"? (was Re: Funny mistake) Message-ID: <13982@helios.TAMU.EDU> Date: 1 Apr 91 05:33:51 GMT References: <15053@ganymede.inmos.co.uk> <10655@uwm.edu> <13980@helios.TAMU.EDU> Sender: usenet@helios.TAMU.EDU Organization: College of Architecture, Texas A&M University. Lines: 17 In article <13980@helios.TAMU.EDU> byron@archone.tamu.edu (Byron Rakitzis) writes: >In article <10655@uwm.edu> markh@csd4.csd.uwm.edu (Mark William Hopkins) writes: >>if ((A = f1()) != 2 || (A = f2()) != 3 || (A = f3()) != 4) > [etc.] >Note that the above line does *not* read: > if (!(A = f1() - 2 && A = f2() - 3 && A = f3() - 4)) >which I consider to be in the Canonical Obfuscated Form. In my anxiousness to convert the first statement to C.O.F., I erroneously inverted the sense of the test. For the pedants on the net, the C.O.F. of the first statement is of course if (A = f1() - 2 || A = f2() - 3 || A = f3() - 4) Pardon my flatulence.