Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ukma!gatech!hubcap!ncrcae!ncrlnk!uunet!mcvax!ukc!mupsy!mucs!r1!chl From: chl@r1.uucp (Charles Lindsey) Newsgroups: comp.lang.misc Subject: Re: Algol-style semicolons (was Re: What makes a language successful) Keywords: semicolons, statements, end Message-ID: <5319@ux.cs.man.ac.uk> Date: 16 Dec 88 11:04:38 GMT References: <1126@etive.ed.ac.uk> <208100002@s.cs.uiuc.edu> <868@mcrware.UUCP> Sender: news@ux.cs.man.ac.uk Reply-To: chl@r1.UUCP (Charles Lindsey) Organization: University of Manchester, UK Lines: 51 In article <208100002@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu (Alan Carroll) writes: >/* Written 10:10 am Dec 4, 1988 by bct@lfcs.ed.ac.uk in s.cs.uiuc.edu:comp.lang.misc */ >/* ---------- "Re: What makes a language successfu" ---------- */ > Another sad point is that even died-in-the wool Algol 68 people like Charles >Lindsey have drifted into putting semi-colons before ENDs. Time for "died-in-the-wool Charles Lindsey" to say what he really does. >I always thought that the 'no ; before END' part of PASCAL was one of the worst >'features' of the language. First let us understand the rules: PASCAL has a dummy-statement, so ';' before END is OK ALGOL 68 has no dummy-statement, so ';' before END is forbidden In article <868@mcrware.UUCP> jejones@mcrware.UUCP (James Jones) writes: >I never could understand what the difficulty is with Algol-style semicolons. >... In Algol, semicolons *separate* statements. ... Yes, but Carroll still has a point >... I can't count how many times I had to recompile >because I had added a statement before an END and forgotten to put a ; on >the *previous* statement. Here is what Charles Lindsey actually does: When writing in PASCAL, I always put a ';' at the end of each statement, even before an END, for the reason Carroll gave. When writing in ALGOL 68, I always put a ';' BEFORE each statement (except the first). Here is the example that started all the fuss (so far as I remember it). BEGIN LOC INT i := 0, j := 1 ; LOC REF INT ptr := i ; ptr := j ; print(i) END >{James Jones again} "end" and "begin" serve the same purpose as paren- >theses, and indeed, Algol 68 makes this even more obvious by allowing the >use of parentheses in place of begin and end if one wishes. Indeed, and it looks even better (and is easier to type) this way: ( LOC INT i := 0, j := 1 ; LOC REF INT ptr := i ; ptr := j ; print(i) ) Charles Lindsey chl@ux.cs.man.ac.uk