The semicolon habit (was: Q: Definition of a scripting lang.)

prechelt@i41s25.ira.uka.de (Lutz Prechelt)
Tue, 11 Apr 1995 13:17:25 GMT

          From comp.compilers

Related articles
Re: Q: Definition of a scripting lang. lwall@netlabs.com (1995-03-27)
Re: Q: Definition of a scripting lang. rpereda@wotangate.sc.ti.com (1995-04-05)
The semicolon habit (was: Q: Definition of a scripting lang.) prechelt@i41s25.ira.uka.de (1995-04-11)
Re: The semicolon habit (was: Q: Definition of a scripting lang.) stidev@gate.net (1995-04-19)
Re: The semicolon habit (was: Q: Definition of a scripting lang.) cef@geodesic.com (Charles Fiterman) (1995-04-19)
Re: The semicolon habit (was: Q: Definition of a scripting lang.) ludemann@netcom.com (1995-04-28)
Re: The semicolon habit (was: Q: Definition of a scripting lang.) scooter@mccabe.mccabe.com (1995-04-27)
Re: The semicolon habit (was: Q: Definition of a scripting lang.) cg@Myrias.AB.CA (1995-04-27)
Re: The semicolon habit (was: Q: Definition of a scripting lang.) schrod@iti.informatik.th-darmstadt.de (1995-04-28)
[19 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: prechelt@i41s25.ira.uka.de (Lutz Prechelt)
Keywords: syntax
Organization: University of Karlsruhe, FRG
References: 95-04-013 95-04-056
Date: Tue, 11 Apr 1995 13:17:25 GMT

rpereda@wotangate.sc.ti.com (Ramon Pereda, ) writes:
...
|> Icon has makes an interesting distinction between whitespace and newlines.
|> Newline automatically inserts a semicolon at the end of a line,
|> if an "expression" ends on that line and the next line begins with another.


|> Forgetting a trailing semicolon is a common goof in a variety of languages
|> such as Perl, Ada, Pascal, and C. I see pitfalls like this as flaws in the
|> language, not the novice programmer.


Indeed the semicolons can be a nuisance.
And it is surprisingly simple (surprising only for us semicolon-grown
programmers) to create a syntax that needs no semicolons.


In a language I designed, whose syntax is similar to Modula-2,
I once tried to simply remove all semicolons from the syntax.
It turned out that the only place where they were needed was
at an optional keyword where one could write either
    END;
or
    END IF;
and both meant exactly the same.


Perhaps semicolons are just a habit?


    Lutz


--
Lutz Prechelt (http://wwwipd.ira.uka.de/~prechelt/)
Institut fuer Programmstrukturen und Datenorganisation
Universitaet Karlsruhe; 76128 Karlsruhe; Germany
(Voice: +49/721/608-4068, FAX: +49/721/694092)
--


Post a followup to this message

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