Path: utzoo!attcan!uunet!mcvax!hp4nl!orcenl!bengsig From: bengsig@oracle.nl (Bjorn Engsig) Newsgroups: comp.lang.c Subject: Re: Problem with ()?():() as ending test in for-loop Message-ID: <344.nlhp3@oracle.nl> Date: 25 May 89 11:04:16 GMT References: <17722@mimsy.UUCP> Reply-To: bengsig@oracle.nl (Bjorn Engsig) Organization: ORACLE Europe, The Netherlands Lines: 11 In article <17722@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: > (Any valid `logical' [true/false] >e1?e2:e3 expression can always be transformed this way into (e1&&e2)||e3, >provided e3 has no side effects.) No Chris, this was a bit too fast. If e1!=0 and e2==0, (e1&&e2)||e3 evaluates e3 and returns it's truth value, whereas (e1?e2:e3) returns 0 and does not evaluate e3. -- Bjorn Engsig, ORACLE Europe \ / "Hofstadter's Law: It always takes Path: mcvax!orcenl!bengsig X longer than you expect, even if you Domain: bengsig@oracle.nl / \ take into account Hofstadter's Law"