"C" wish list/semicolons

Joseph S. D. Yao jsdy at hadron.UUCP
Thu Nov 7 15:22:39 AEST 1985


In article <142 at ucbjade.BERKELEY.EDU> mwm at ucbopal.UUCP (Mike (I'll be mellow when I'm dead) Meyer) writes:
>Taking that into account, the best thing for semicolons is:
>	Let them separate two staments on the same line. Let line breaks
>	terminate statements if it makes sense to do so.
>For example, a block could look like:
>	{
	...
>	f = x + 7	/* Does this end? */
>		* y	/* Uh, no... */
>	}

Conveniently ignoring or forgetting that this is legal as two
separate statements, also!  Yes, the second is a no-op -- but
it parses correctly.  Here's another:
	{
		x = func2
			(bool)
		y = TRUE
	}
Now, in 2 seconds, tell me whether I forgot to typedef char bool
and func2 is an int, or forgot to declare bool and func2 is an
int ().

Not so easy, eh?  The point is that between BCPL and C we gained
a lot of richness & complexity, which makes it necessary to use
a slightly more complicated grammar to express all this neat stuff.
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list