A Modest Extension to the C Preprocessor

Marc Elvy elvy at harvard.ARPA
Fri Aug 3 08:26:41 AEST 1984


Actually, the #use suggestion sounds like a practical idea, but I doubt the
C "purists" will go for it.  Taking the suggestion one step farther, one
might use something like

	# require	DEFINITION	file

In case it is not obvious, this would act as follows:  If DEFINITION is
already defined, then the statement could be ignored; if DEFINITION is
not defined, then "file" would be #included.  This would, I suppose, take
the place of all the

	# ifndef	DEFINITION
	# include	file
	# endif		DEFINITION

sequences which are probably around.  Something like this would certainly
make my life a lot happier, since I am constantly having fights about
whether .h files should depend upon other .h files already being #included.
Incidentally, this is not my idea, per se -- the (require) function exists
in at least one Lisp system (T) and probably several others.

Marc

		      Marc A. Elvy  ( elvy at harvard.{arpa,uucp} )
			     Aiken Computation Laboratory
				  Harvard University



More information about the Comp.lang.c mailing list