Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!mordor!joyce!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.lang.misc Subject: Re: Query re optimising hcrs Message-ID: <1113@garth.UUCP> Date: 30 Jul 88 21:13:37 GMT References: <561@etive.ed.ac.uk> <24414@think.UUCP> <3678@hcr.UUCP> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 13 > Only if the order that logical expressions is calculated >is undefined is this optimization reasonable. That is why it is better to leave the order of evaluation undefined. > if( (p != NULL) && (*p == VALUE) ) > >where I check that the pointer is good and then check the value. Reorganize >this and all hell will break loose. C, Algol60, and Algol68 provide an alternate construct which safe, explicit, and lets the operators be just operators: if ( p==nil ? false : *p==value )