Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!swbatl!texbell!cpsolv!rhg From: rhg@cpsolv.CPS.COM (Richard H. Gumpertz) Newsgroups: comp.lang.c Subject: Re: Summary: Is this swap() macro correct? Message-ID: <488@cpsolv.CPS.COM> Date: 24 Jan 90 14:32:32 GMT References: <1990Jan18.002842.441@aqdata.uucp> <4514@rtech.rtech.com> <790@stealth.acf.nyu.edu> Reply-To: rhg@cpsolv.uucp (Richard H. Gumpertz) Distribution: usa Organization: Computer Problem Solving, Leawood, Kansas Lines: 15 In article <790@stealth.acf.nyu.edu> brnstnd@stealth.acf.nyu.edu (Dan Bernstein) writes: >The second is a more general religious argument: Macros should feel like >functions. As above, they should reference each argument exactly once; >if an argument is modified, the macro should use a pointer to it instead; >and so on. If C only had inline functions, this would be all be so much simpler. The compiler would be able to handle the side-effects issues automatically. -- ========================================================================== | Richard H. Gumpertz rhg@CPS.COM (913) 642-1777 or (816) 891-3561 | | Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 | ==========================================================================