Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!ima!ISM780B!jim From: jim@ISM780B.UUCP Newsgroups: net.lang.c Subject: Re: context-independent macros Message-ID: <144@ISM780B.UUCP> Date: Fri, 8-Feb-85 01:08:25 EST Article-I.D.: ISM780B.144 Posted: Fri Feb 8 01:08:25 1985 Date-Received: Sat, 9-Feb-85 08:52:46 EST Lines: 12 Nf-ID: #R:ucbtopaz:-69500:ISM780B:25500108:000:468 Nf-From: ISM780B!jim Feb 6 18:56:00 1985 >So the solution is to write the macro to only use an expression: > > #define assert(x) ((x)? 0: complain ("x not true")) >or > #define assert(x) ((x) || complain ("x not true")) > >I think everybody will find the first form clearer except sh programmers. :-) The first form gets "null effect" from lint, but the second form is just right, and I myself will start using it immediately. Thanks. -- Jim Balter, INTERACTIVE Systems (ima!jim)