Optional semi-colons

Herman Rubin cik at l.cc.purdue.edu
Mon May 1 23:51:39 AEST 1989


In article <225800165 at uxe.cso.uiuc.edu>, mcdonald at uxe.cso.uiuc.edu writes:
> 
> 
> >For example, the C preprocessor. Having a unique statement terminator frees
> >the programmer of worrying where newlines might show up after macro expansion.
> 
> Really? What happens if macro expansion results in a string longer
> than 509 characters, or an expression several thousands of bytes long?
> I have had both of those happen. Serious worries result.
> 

In C, there is already a situation in which semicolons are not used for
terminators, newlines are, and there is provision for multiple line statements.

This is in #defines, where semicolons frequently occur.  It is necessary to
escape a newline to prevent termination.  Why not do this in the language?
It handles the situation of multi-line statements without requiring a statement
termination character.  One could still allow semicolons to end statements, so
existing code could be reasonably edited.

-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin at l.cc.purdue.edu (Internet, bitnet, UUCP)



More information about the Comp.lang.c mailing list