Re: Automatic allocation of an available file unit
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Fri, 31 Mar 2006 09:07:42 -0800
Pierre Asselin <pa@xxxxxxxxxxxxxxxxxxxxx> wrote:
Richard Maine <nospam@xxxxxxxxxxxxx> wrote:
[ ... ] So I
fail to see how numbers that were formerly valid could have fewer
conflicts than ones that were formerly invalid.
By old code assuming that negative numbers cannot refer to
a valid unit.
Note that that assumption is already semi-broken by f2003. But I'll
admit that it is in a narrow enough case that the odds of old code
conflicting with it are negligable. It comes up in user-defined I/O. So
if your new (by definition) user-defined I/O procedure happens to invoke
procedures with old code, it could possibly come up. But that's just not
going to happen much.... if ever.
My own personal preference in this is to get out of using numbers for
this purpose at all. Of course, you'd have to phase them out over an
awfully long time (longer than any of us will ever see), but at least
one could fix the problem for new code. I was dissapointed to see that a
proposal to do that didn't "make the cut" at the last meeting. Seems to
me that any scheme to assign unit numbers is just a hack workaround.
Yes, it is what "everyone" (including me) does. I do agree that it is
better to standardize the workaround than to have everyone do their own
separate ones, which might not always work well together. And the
workaround is simpler to hack into old codes. But I'm still dissapointed
that the real fix got rejected.
The "real" fix is to have a non-numeric "handle". We already have the
basic mechanism for such "handles". It is a derived type with private
components; that perfectly matches the functionality of what is called a
"handle" in some other environments. The open statement would return the
handle, and the user would then just pass it around, without being able
to "muck" with its innards (well, not without "cheating", but we always
have that). All the I/O statements could take either a handle or a unit
number.
There was a proposal along that line.
I'm not sure why it didn't fly. Maybe a majority just thought it more
work than it was worth. (I'd disagree, but then I wasn't even there to
vote; doesn't look like one vote would have changed it anyway). Or maybe
it is just conservatism. For all the "newfangled" stuff that gets
proposed in some areas, I've personally noticed a reluctance in the
committee to use some of the features in the language itself. In
particular, using derived types for features of the standard doesn't
seem to go over very well, at least in my observation.
--
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
.
- References:
- Automatic allocation of an available file unit
- From: Joe Krahn
- Re: Automatic allocation of an available file unit
- From: Richard Maine
- Re: Automatic allocation of an available file unit
- From: Pierre Asselin
- Automatic allocation of an available file unit
- Prev by Date: Re: Converting fixed-to-free format
- Next by Date: Re: Automatic allocation of an available file unit
- Previous by thread: Re: Automatic allocation of an available file unit
- Next by thread: Re: Automatic allocation of an available file unit
- Index(es):