Why nested comments not allowed?

Barton E. Schaefer schaefer at ogicse.ogc.edu
Wed Feb 21 03:35:58 AEST 1990


In article <1990Feb19.221039.4243 at agate.berkeley.edu> raymond at math.berkeley.edu (Raymond Chen) writes:
} Dear everyone who wants to argue that nested comments are "good", "easy to
} implement", "has no hidden surprises":
} 
} Please present a coherent rule for nested comments for which the following
} lines of code produce "expected" results:

Actually, the cases presented are not in themselves very interesting.
The interesting thing is trying to parse "code" like that after
commenting it out:

	/* Commented out ...
	/* ... with extra nesting just for fun
	int openquote = 34; /* " */ int closequote = 34; /* Also " */
	int quote = 34; /* for a good time, type printf("*/ %c",quote) */
	/* int doublequote = 34; /* " */ */ /* don't need this one: '"' */
	/* printf("*/ is the close-comment token\n"); 
	   printf("/* is the \"open-comment\" token\n"); */
	*/ end extra */

-- 
Bart Schaefer          "February.  The hangnail on the big toe of the year."
                                                                    -- Duffy

schaefer at cse.ogi.edu (used to be cse.ogc.edu)



More information about the Comp.lang.c mailing list