Re: Namelist Internal Read

gary.l.scott_at_lmco.com
Date: 03/28/05


Date: 28 Mar 2005 08:18:14 -0800


Richard E Maine wrote:
> In article <114egelkpod1v9c@corp.supernews.com>,
> "Gary L. Scott" <garyscott@ev1.net> wrote:
>
> > I want to be able to do this:
> [namelist I/O on an internal file]
> > Why is it prohibited?
>
> It is allowed in f2003 (at least I don't off-hand see the restriction

> any more and I think I recall that change; I didn't study carefully).
>
> As for why it was disallowed earlier, well, you know the usual
answer. I
> don't think you'll find a whole lot more insight than that. To my
> knowledge, the reason was nothing more esoteric than that f90 was
> already a big enough change to be very controversial, and there was
> little or no demand expressed for namelist I/O on internal files.
> Adding a features that had no demand probably didn't play well with
> trying to cut down the feature set enough to get approval.
>
> Of course, if you want to argue that it would probably have been
simpler
> to allow it than to disallow it, that's hindsight from a different
> viewpoint. I suspect that has some to do with why it got added later
-
> because it became viewed as such a simple thing that "why not?
Somebody
> might want it someday." was good enough reason.

For me, someday was about 18 years ago. I use namelist as a simple
macro language processor. A text file might have something like:

!!!begin
move x=4.0, y=4.0
line x=1.0, y=2.0
font xsize=0.5, ysize=1.0, typeface='Arial'
text x=1.0, y=2.0 string='This is a test'
!!!end

I read the file in a line at a time, mark it up as a namelist and let
namelist do the parsing. Of course it is limited, but it works very
well for what I use it for with exception that error reporting is very
limited (and it is annoying to have to write the markup to a scratch
file to read it with namelist). It wouldn't be that difficult to write
a more thorough processor, but namelist seems to be so close that only
a few changes might turn it into a full-fledged parser.

I've also never quite understood the need for the quirky &.../ syntax.

>
> > I'd also like a few IOSTAT variables defined to
> > diagnose various errors.
>
> Specifying I/O errors in the standard is a vary large and continuing
> source of controversy. I won't get into that here. It has been at
least
> touched on a few times in clf. I'd say that the odds of namelist
being a
> major factor in pushing for that are negligable. You'll have to get
the
> standard to specify any I/O errors at all before you get into the
level
> of detail mentioned in your [elided] wish list.
>
> --
> Richard Maine | Good judgment comes from
experience;
> email: my first.last at org.domain | experience comes from bad
judgment.
> org: nasa, domain: gov | -- Mark Twain