Re: language design implications for variant records in a pascal-like language

"robin" <robin51@dodo.com.au>
Wed, 19 Jan 2011 01:34:26 +1100

          From comp.compilers

Related articles
[53 earlier articles]
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-16)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-17)
Re: language design implications for variant records in a pascal-like torbenm@diku.dk (2011-01-17)
Re: language design implications for variant records in a pascal-like dot@dotat.at (Tony Finch) (2011-01-17)
Re: language design implications for variant records in a pascal-like genew@ocis.net (Gene Wirchenko) (2011-01-17)
Re: language design implications for variant records in a pascal-like mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-01-18)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-19)
Re: language design implications for variant records in a pascal-like 9cn6w6402@sneakemail.com (Peter Canning) (2011-01-18)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-24)
| List of all articles for this month |
From: "robin" <robin51@dodo.com.au>
Newsgroups: comp.compilers
Date: Wed, 19 Jan 2011 01:34:26 +1100
Organization: Compilers Central
References: 11-01-057 11-01-063 11-01-068
Keywords: design, history
Posted-Date: 18 Jan 2011 23:36:20 EST

From: "robin" <robin51@dodo.com.au>
Sent: Monday, 17 January 2011 11:55 AM


>> <compilers@is-not-my.name>


> Had spaces been significant, DO 10 I would have been parsed as three
> separate tokens. As it was, FORTRAN parsed it as the single token
> "DO10I", which was a legal identifier.
> [That's an egregious example, but I've written plenty of buggy code where
> I spelled a variable name in two ways. Not really a compiler issue, though,
> since it's easy enough to implement either way. -John]


The reason that many mis-spellings passed by unnoticed in FORTRAN was
that most compilers of the time produced only a compilation listing.


IBM PL/I compilers at that time produced not only a compilation
listing, but also an attribute listing (a list of identifiers,
attributes, and cross-references). That way it was easy to detect
mis-spelled identifiers.


Now, Fortran has not only free-form source, where blanks are significant --
which avoids constructs such as DO I = 1.10 becoming an assignment --
plus an IMPLICIT NONE statement which, when employed,
reports as errors any undeclared identifiers.


IBM's current PL/I compilers also have a compiler option that causes
undeclared identifiers to be classified as errors.


Post a followup to this message

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