Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!decwrl!decvax!tektronix!tekcrl!tekgvs!toma From: toma@tekgvs.GVS.TEK.COM (Tom Almy) Newsgroups: comp.lang.misc Subject: Re: Algol-style semicolons (was Re: What makes a language successful) Keywords: semicolons, statements, end Message-ID: <4396@tekgvs.GVS.TEK.COM> Date: 19 Dec 88 18:16:01 GMT References: <1126@etive.ed.ac.uk> <208100002@s.cs.uiuc.edu> <868@mcrware.UUCP> Reply-To: toma@tekgvs.GVS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 23 The question in my mind is *not* "Is a semicolon a statement separator or statment delimiter?" but *is* "Why do we need semicolons at all?". Many years ago (about 20) I took a compiler writing class where we had to write a compiler for an "Algol" like language. A few weeks into the project my partner and I noticed that the only thing our recursive descent parser did with semicolons was to issue an error message if they were absent! So we altered the language spec to eliminate semicolons altogether! In the same time frame, I was using BCPL (the predicessor of C). BCPL would assume a semicolon at the end of each line which could be successfully parsed as a statment. This eliminated virtually all the semicolons in every BCPL program I wrote, yet the rule cost virtually nothing in parsing overhead. I would contend that most, if not all, Algol-derived languages would work just fine without semicolons! The only problem being the way some languages define control structures require the existance of the semicolon as a null statement. Tom Almy toma@tekgvs.tek.com Standard Disclaimers Apply