🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6016

Re: Algol-style semicolons

#6016
From: Gary Levin
Date: Thu, 15 Dec 1988 19:26
45 lines
2061 bytes
In article <8008@aw.sei.cmu.edu> firth@sei.cmu.edu (Robert Firth) writes:
   ...
   The best, in my opinion, is to have the semicolon optional: a newline
   will terminate the statement if possible.  So you can write

	   x := x+1
	   y := y+1

   and it works, but

	   x := a0+a1+a2+
		a3+a4+a5

   also works.  One hardly ever gets this wrong.

However, if you are in an expression oriented language, it is possible
to get really strange effects here.  I would write the above statement
as:

	   x := a0+a1+a2
		+a3+a4+a5;

Having submitted this to Icon, I found that the program didn't work as
expected.  It took me quite a bit of debugging to find that this was
being treated as two statements, and so x was only assigned a0+a1+a2.
Further, I then tried to write this as

	   x := (a0+a1+a2
		+a3+a4+a5);

and I was informed that I was missing a right parenthesis after a2
(and before the inserted semicolon).  Note that Icon would correctly
handle the case of the trailing + as Firth wrote his example.

Generally, I prefer systems that have me say what I mean, rather than
guess.  And if they must guess, they should have the grace to indicate
their guesses.

It is certainly possible that Icon no longer suffers from this
particular lexical/syntactic quirk; I haven't used it in quite a while.
--

-----
Gary Levin/Dept of Math & CS/Clarkson Univ/Potsdam, NY 13676/(315) 268-2384
BitNet: gary@clutx   Internet: gary@clutx.clarkson.edu
Technical Details
Message-ID: <GARY.88Dec15142623@milo.mcs.clarkson.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!cornell!batcomputer!sun.soe.clarkson.edu!gary
References: <1126@etive.ed.ac.uk> <208100002@s.cs.uiuc.edu> <868@mcrware.UUCP> <8008@aw.sei.cmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!cornell!batcomputer!sun.soe.clarkson.edu!gary
From: gary@milo.mcs.clarkson.edu (Gary Levin)
Newsgroups: comp.lang.misc
Subject: Re: Algol-style semicolons
Message-ID: <GARY.88Dec15142623@milo.mcs.clarkson.edu>
Date: 15 Dec 88 19:26:23 GMT
References: <1126@etive.ed.ac.uk> <208100002@s.cs.uiuc.edu> <868@mcrware.UUCP> <8008@aw.sei.cmu.edu>
Sender: news@sun.soe.clarkson.edu
Organization: Clarkson University, Postdam NY
Lines: 44
In-reply-to: firth@sei.cmu.edu's message of 15 Dec 88 13:30:25 GMT