Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 v7 ucbtopaz-1.8; site ucbtopaz.CC.Berkeley.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!ucbvax!ucbtopaz!mwm From: mwm@ucbtopaz.CC.Berkeley.ARPA Newsgroups: net.lang.c Subject: context-independent macros Message-ID: <695@ucbtopaz.CC.Berkeley.ARPA> Date: Thu, 31-Jan-85 22:51:50 EST Article-I.D.: ucbtopaz.695 Posted: Thu Jan 31 22:51:50 1985 Date-Received: Sun, 3-Feb-85 08:50:07 EST References: <1885@wateng.UUCP> <1089@hcrvx1.UUCP> <33@daisy.UUCP> <1097@hcrvx1.UUCP> Reply-To: mwm@ucbtopaz.UUCP (Praiser of Bob) Organization: Univ. of Calif., Berkeley CA USA Lines: 23 Summary: Instead of: # define macro(args)\ if (1) {\ /* macro body */\ }\ else How about: #define macro(args)\ (Statement1 ,\ Statement2 ,\ ... Statement3) This should work correctly anywhere a function call works, as it is a single statement. The question is whether or not the evaluation order is preserved. Anybody want to say whether order is/isn't preserved (or do K&R remain silent), or poke any holes in this?