Related articles |
---|
[10 earlier articles] |
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-14) |
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17) |
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17) |
Re: problems with identifiers and keywords... lkrupp@pssw.NOSPAM.com.INVALID (Louis Krupp) (2004-11-17) |
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-17) |
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-11-19) |
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-19) |
Re: problems with identifiers and keywords... gracjan@acchsh.nospam.com (Gracjan Polak) (2004-11-19) |
Re: problems with identifiers and keywords... Martin.Ward@durham.ac.uk (Martin Ward) (2004-11-19) |
Re: problems with identifiers and keywords... Peter_Flass@Yahoo.com (Peter Flass) (2004-11-20) |
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-20) |
Re: problems with identifiers and keywords... david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-28) |
Re: problems with identifiers and keywords... cgweav@aol.com (2004-11-29) |
[4 later articles] |
From: | glen herrmannsfeldt <gah@ugcs.caltech.edu> |
Newsgroups: | comp.compilers |
Date: | 19 Nov 2004 00:51:43 -0500 |
Organization: | Comcast Online |
References: | 04-10-148 04-10-170 04-10-174 04-11-008 04-11-011 04-11-054 |
Keywords: | syntax, design, comment |
Posted-Date: | 19 Nov 2004 00:51:43 EST |
Louis Krupp wrote:
(snip)
> My objection to languages that allow keywords as identifiers (not that
> I've written any FORTRAN in a long time or a lot of PL/I at any time):
> I would think that a program that used keywords as identifiers would
> make sense to a programmer who didn't use the features that required
> those keywords but would look strange to a programmer who used those
> features regularly and therefore was not in the habit of using those
> keywords as identifiers (if that makes sense).
(snip)
In Fortran 66 it is possible to use a variable in place of a FORMAT
statement. It must be an array, and the array must contain that
represent the desired format. To me, the most obvious name for such
an array is FORMAT. If you believe in using descriptive names for
identifiers, what else would you call it (in six characters or less)?
The WATFIV compiler has only one restriction on the use of keywords as
identifiers: an array named FORMAT is not allowed (or at least can't
appear on the left side of an = sign). There are some almost
ambiguous cases that can be made, especially considering the Hollerith
format descriptor.
Even in that case, though, I think it is usually not so hard for a
human to recognize, and if it is comment statements should be used to
describe what it is doing.
A statement of the form
FORMAT(1)=FMTA
is fairly easy for a person to recognize. For one, compilers
generally parse from left to right, but people can parse in a more
general way. I would probably see the = sign first, recognize that it
wasn't part of a FORMAT statement, and so an assignment statement.
-- glen
[You can write non-format statements that look arbitrarily confusing:
3 FORMAT(I5,A6)=42
Of course, since this is the language where you can write DO 10 I = 1.10
we shouldn't be surprised. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.