defining a comment?

Simon A Reap sar at datcon.UUCP
Sat Sep 24 01:17:10 AEST 1988


In article <768 at proxftl.UUCP> bill at proxftl.UUCP (T. William Wells) writes:
>In article <5438 at techunix.BITNET> benny%techunix.bitnet at jade.berkeley.edu
							(Benny Pinkas) writes:
>: Can I use the Preprocessor to define a comment?
>
>No.
>
>---
>Bill
>novavax!proxftl!bill

Pyramid C (at least) says "Comments? Don't just say no!'

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...' :^).

Good luck, Benny!
-- 
Enjoy,
yerluvinunclesimon                Opinions are mine - I don't even have a cat
Reach me at sar at datcon.co.uk, or ...!mcvax!ukc!pyrltd!datcon!sar



More information about the Comp.lang.c mailing list