[net.lang.c] Wish List for CPP

ted@scc.UUCP (Ted Goldstein) (10/01/84)

As long as we are compiling a wish list, how about
having CPP count arguments. For example instead of
writing:


#ifdef DEBUG_ON
#define DEBUG1(a)   printDebug(1, a)
#define DEBUG2(a,b)   printDebug(2, a, b)
/* etc */
#else
#define DEBUG1(a)
#define DEBUG2(a,b) 
/* etc */
#endif

we could write

#ifdef DEBUG_ON
#define DEBUG(,) printDebug(numArgs, )
#else
#define DEBUG(,)
#endif

This would also assist in validating things like printf:

#define printf(,) _printf(numArgs,)

if numArgs doesn't  agree with the number of formatting
expressions, it could complain.

Any comments?
	Ted Goldstein


From postnews Mon Oct  1 12:03:23 1984

Subject: Re: Fuel for your flames: Things I would like in CPP
Newsgroups: net.lang.c
References: <9225@watmath.UUCP>


As long as we are compiling a wish list, how about
having CPP count arguments. For example instead of
writing:


#ifdef DEBUG_ON
#define DEBUG1(a)   printDebug(1, a)
#define DEBUG2(a,b)   printDebug(2, a, b)
/* etc */
#else
#define DEBUG1(a)
#define DEBUG2(a,b) 
/* etc */
#endif

we could write

#ifdef DEBUG_ON
#define DEBUG(,) printDebug(numArgs, )
#else
#define DEBUG(,)
#endif

This would also assist in validating things like printf:

#define printf(,) _printf(numArgs,)

if numArgs doesn't  agree with the number of formatting
expressions, it could complain.

Any comments?
	Ted Goldstein