Re: Semicolons (Re: Low-Rent Syntax)

Chuck Lins <lins@apple.com>
5 Sep 90 10:24:18

          From comp.compilers

Related articles
[4 earlier articles]
Re: Semicolons (Re: Low-Rent Syntax) mjr@decuac.DEC.COM (1990-08-25)
Re: Semicolons (Re: Low-Rent Syntax) bart@videovax.tv.tek.com (Bart Massey) (1990-08-26)
Re: Semicolons (Re: Low-Rent Syntax) elsie!ado@uunet.UU.NET (1990-08-27)
Re: Semicolons (Re: Low-Rent Syntax) anw@maths.nott.ac.uk (1990-08-29)
Re: Semicolons (Re: Low-Rent Syntax) liam@cs.qmw.ac.uk (1990-09-03)
Re: Semicolons (Re: Low-Rent Syntax) firth@sei.cmu.edu (1990-09-05)
Re: Semicolons (Re: Low-Rent Syntax) lins@apple.com (Chuck Lins) (1990-09-05)
Re: Semicolons (Re: Low-Rent Syntax) rob@baloo.eng.ohio-state.edu (1990-09-05)
Re: Semicolons (Re: Low-Rent Syntax) MERRIMAN@ccavax.camb.com (George Merriman -- CCA/NY) (1990-09-05)
Re: Semicolons (Re: Low-Rent Syntax) dik@cwi.nl (1990-09-06)
Re: Semicolons (Re: Low-Rent Syntax) dolf@idca.tds.philips.nl (Dolf Grunbauer) (1990-09-15)
Re: Semicolons (Re: Low-Rent Syntax) rhl@grendel.princeton.edu) (1990-09-06)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Chuck Lins <lins@apple.com>
Keywords: parse, design
Organization: Compilers Central
Date: 5 Sep 90 10:24:18

>The thing I hate most about Modula-2 is that it won't allow a semicolon on
>the last statement of a loop-body, on the dubious grounds that you don't need
>one.


There is considerable difference between 'not allowed' and 'not required'.
Modula-2 does not *require* the semicolon on the last statement of a loop body
(or any other place where a statement sequence is allowed). For the reason you
mention (maintainability) it's useful to always use the semicolon. I've been
doing this for 10 years now. If you compiler won't let you write,


WHILE (x > 0) DO
        DEC(x); (* <-- a semicolon, gentle reader *)
END;


your compiler is broken. In Modula-2, empty statements may freely occur within
a statement sequence. An empty statement consists of just a semicolon since
it's merely a separator.


--
Chuck Lins (lins@apple.com)
Apple Computer, Inc
20525 Mariani Ave
MS 37-BD
Cupertino, CA 95014 USA
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.