[net.lang.c] Suggestion for cpp

decot@cwruecmp.UUCP (Dave Decot) (02/15/84)

How many zillion times have you wanted to comment out one or more C functions,
or a block of lines?  A few day's experience with the language teaches anyone
that you can't just

    #include <irxg8w0V.h>

    /*
    wow(gosh, golly, jeepers)
    int gosh, golly, jeepers;		/* snazzy parameters */
    {
	int ooh, aah;			/* amazing variables */

	ooh = _IRXG8W0_BUFQT;		/* fascinating constant */

	for (golly = 0; gosh < jeepers; ooh++) {
	    gosh *= ooh;
	    golly -= jeepers? gosh : IRXG8W0_KIZM;
	}
    */

the function because comments end at the first */.  So, why not two new cpp
commands:

    #{
	...
    #}

which cause the preprocessor to ignore everything intervening?  I realize that

    #if 0
	...
    #endif

does the same thing, but it isn't as clear.  How about it?

Dave Decot		 "Non-Americans are people, too."
decvax!cwruecmp!decot    (Decot.Case@rand-relay)

jonab@sdcrdcf.UUCP (Jonathan Biggar) (02/17/84)

In article <1010@cwruecmp.UUCP> decot@cwruecmp.UUCP (Dave Decot) writes:
>So, why not two new cpp commands:
>
>    #{
>	...
>    #}
>
>which cause the preprocessor to ignore everything intervening?  I realize that
>
>    #if 0
>	...
>    #endif
>
>does the same thing, but it isn't as clear.  How about it?

Use this:

#ifdef COMMENTED_OUT_CODE
    ...
#endif

This is VERY clear and does not require modifying cpp.

Jon Biggar
{allegra,burdvax,cbosgd,hplabs,ihnp4,sdccsu3,trw-unix}!sdcrdcf!jonab