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.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.