Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!oberon!stromboli.usc.edu!english From: english@stromboli.usc.edu (Joe English) Newsgroups: comp.lang.c Subject: Nonsyntactic macros (was Re: Standard indentation?) Message-ID: <14107@oberon.USC.EDU> Date: 16 Dec 88 23:23:12 GMT References: <641@htsa.uucp> <6580@polyslo.CalPoly.EDU> <2417@ssc-vax.UUCP> Sender: news@oberon.USC.EDU Reply-To: english@stromboli.usc.edu (Joe English) Organization: University of Southern California, Los Angeles, CA Lines: 33 In article <2417@ssc-vax.UUCP> dmg@ssc-vax.UUCP (David Geary) writes: >One of the first things that students in my C class who are reformed >;-) Pascal programmers, want to do is this: > >#define BEGIN { >#define END } > >and a whole slew of other macros to make C look like pascal. > Which, being new C programmers, they don't really know how to do. Just the other day I was helping an incorrigible Pascal programmer debug some C code. She was only using C out of necessity, and had done the following: #define begin { #define end; } Which is not only wrong, but can be wrong in different ways depending on the preprocessor! I really think that it was a bad idea for K&R to mention that this sort of thing is possible. Is their discussion of non-syntactic macros in the 2nd edition, too? /|/| "How do you convince your dermatologist -----< | | that you're being sexually responsible? O \|\| english%lipari@oberon.usc.edu