Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark From: ark@alice.UucP (Andrew Koenig) Newsgroups: net.lang.c Subject: Re: "C" wish list/semicolons Message-ID: <4528@alice.UUCP> Date: Wed, 6-Nov-85 11:28:41 EST Article-I.D.: alice.4528 Posted: Wed Nov 6 11:28:41 1985 Date-Received: Thu, 7-Nov-85 06:29:04 EST References: <142@ucbjade.BERKELEY.EDU> Organization: Bell Labs, Murray Hill Lines: 27 > 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: > { > x = 23; y = 40 > z = x + y > printf("Messy Format", x, y, z, > f) /* Statement didn't end, as it wouldn't parse */ > f = x + 7 /* Does this end? */ > * y /* Uh, no... */ > } Ummm... the assignment to f is problematic. Let's change it a bit: f = x + 7 *p++ Now, is this one statement or two? I strongly suggest that if you want to have a syntactic rule for continuing a statement, you make it a lexical rule instead, as in EFL. Thus, if the last token on a line is {insert list here}, the statement is continued. The list would be exactly those tokens that cannot ever end a statement, such as ( = + - * / and so on.