Nonsyntactic macros (was Re: Standard indentation?)

Joe English english at stromboli.usc.edu
Sat Dec 17 09:23:12 AEST 1988



In article <2417 at ssc-vax.UUCP> dmg at 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 at oberon.usc.edu



More information about the Comp.lang.c mailing list