defining a comment?

Mark Nagel nagel at paris.ics.uci.edu
Sun Sep 25 08:39:03 AEST 1988


In article <24 at datcon.UUCP> sar at datcon.co.uk (Simon A Reap) writes:
|
|How about...
|        #define ASTERISK *
|        #define SCOM /ASTERISK
|        #define ECOM ASTERISK/
|        #define PUTCOMM(a) SCOM a ECOM
|
|Then, as sample code.....
|        start comment is SCOM
|        end comment is ECOM
|        comment here -> PUTCOMM(will be inside a comment)
|
|Which produces (at least on a Pyramid, using OSx4.0, in both the att
|and ucb universes, with blanks and other detritus removed for brevity)...
|	start comment is /*
|	end comment is */
|	comment here ->  /* will be inside a comment */
|
|I *can* see a use for this. You may just want to use the pre-processor
|part of cc to produce commented output (yes, I know one should use 'm4'
|for this, but 'better the devil you know...' :^).

I can see all sorts of problems from this.  Why in the world is
everyone so hot to redefine the comment tokens?  I can just see it
now:

SCOM
Add 1 to foo
foo++;
ECOM

and then later in development...

SCOM
Add 1 to foo
foo++;		/* foo controls the register bar */
ECOM

Hmm.  Why is my code blowing up?

-- 
Mark Nagel
Department of Information and Computer Science, UC Irvine
nagel at ics.uci.edu             (ARPA)             When they ship styrofoam...
{sdcsvax|ucbvax}!ucivax!nagel (UUCP)             ...what do they pack it in?



More information about the Comp.lang.c mailing list