[J3] Input/Output for enumerators
Malcolm Cohen
malcolm at nag-j.co.jp
Thu Oct 14 02:51:31 UTC 2021
Yes,
1. we already discussed this and ended up with what we have
2. we need to be fixing what is there, not trying to think of new things.
*IF* (that’s a big IF) we want to discuss it again, and can reach consensus on what to do, and can overcome at least the obvious technical difficulties, and can craft hopefully-small edits to do so, all in a timely fashion, I am not dead set against having “better i/o” here.
I am dead set against ripping out what we have. What we have is not perfect but it *works*. I very much doubt we can come up with something better, and that also works, in a short time frame.
That paper from 2018 has long been overtaken by events. In fact we repudiated key requirements in that paper in the very next meeting! (At which I was not present, being prevented from travelling by a typhoon.)
It is also the case that there are several possibilities for that better i/o, viz
a. the local name as suggested by Van,
b. the name in the type definition,
c. a delimited form of (a) or (b), e.g. <NAME>,
d. a qualified form of (a) or (b), e.g. TYPENAME%NAME.
I find (a) to be completely unacceptable. Users rename stuff to avoid collisions, not to change the output of their program. In fact (a) doesn’t even work, as there might not be a local name (one or more of the enumerators may be inaccessible, e.g. if someone used ONLY).
Also, the A edit descriptor with no width is fine for output, but disastrous for input, as the enumerator names are not required to have the same length. That’s the most obvious technical difficulty. Choosing (c) above might help here, but it would still be quite irregular.
And if we’re going to do “better i/o”, IMO we should do it right, and that means also addressing NAMELIST and list-directed. AND also considering user-defined i/o. There is no way we can possibly do all of these quickly, even if we don’t care about getting it right.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of John Reid via J3
Sent: Wednesday, October 13, 2021 5:39 PM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: John Reid <John.Reid at stfc.ac.uk>; Malcolm Cohen <malcolm at nag-j.co.jp>
Subject: Re: [J3] Input/Output for enumerators
Malcolm,
Is there a good reason against having A format i/o of the enumerator
names as the only i/o mechanism for now? This was the suggestion in US
21 approved in Tokyo. Paper 18-256r1 was the reference used. It contains
this paragraph
"Subgroup considers that the most usable form for i/o for an enumeration
value is the name of the value. Being a name, the A edit descriptor
would be suitable for explicit formatting."
Cheers,
John.
Malcolm Cohen via J3 wrote:
>
> Hi Van,
>
> The G edit descriptor is not permitted for enumeration types,
> precisely to avoid setting in concrete a solution that many would
> disagree with. Only I, B, O and Z are permitted. This is specified in p7.
>
> Nor is list-directed editing permitted, for the same reason, and this
> is also specified in p7.
>
> Nor is namelist editing permitted, for the same reason, and this is
> specified in the NAMELIST subclause.
>
> There are no turds being introduced. (I note this is quite insulting.)
> Instead, we have a smaller feature that we could get consensus on.
>
> There is as yet no consensus on the “right way” for other edit
> descriptors, list-directed, and namelist. The feature is still useful,
> even though it is smaller than we hoped in Tokyo.
>
> Refusing to accept a smaller feature for the time being would not so
> much result in “do nothing”, as result in ripping out the useful
> feature we’ve already put in. That really would not be an improvement.
>
> Cheers,
>
> --
>
> ..............Malcolm Cohen, NAG Oxford/Tokyo.
>
> *From:* J3 <j3-bounces at mailman.j3-fortran.org <mailto:j3-bounces at mailman.j3-fortran.org> > *On Behalf Of *Van
> Snyder via J3
> *Sent:* Tuesday, October 12, 2021 5:12 PM
> *To:* j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org>
> *Cc:* Van Snyder <van.snyder at sbcglobal.net <mailto:van.snyder at sbcglobal.net> >
> *Subject:* Re: [J3] Input/Output for enumerators
>
> On Tue, 2021-10-12 at 16:20 +0900, Malcolm Cohen via J3 wrote:
>
> I do think that many/most of the committee would agree with you
> that treating enumeration types only as integer is, in the
> medium/long term, sub-optimal. I hope that we can get this sorted
> out for the following revision (F202y).
>
> If it is possible to proceed with I/O for typed enumerators as
> integers, and later to allow an A instead of I edit descriptor, the
> half-measure strategy might be workable. The problem comes with the G
> edit descriptor, list-directed editing, and namelist editing. Those
> would be cast in concrete. The concrete might be weakened by promising
> a changeable mode, either for all editing for typed enumerators, or to
> specify whether I or A editing is used for G, list-directed, or
> namelist I/O.
>
> The history of Fortran is replete with yielding to pressure to do a
> half-way job to get "something," even if it's a half-measure that's
> painted into a corner, resulting in an irreversable kludge. The
> alternative is what has driven people away from Fortran: The language
> advances slower than molasses in January.
>
> The choices seem to be
>
> 1. Do nothing
>
> 2. Do a half-measure, hoping to polish a turd later
>
> 3. Work harder.
>
> Will doing I/O for typed enumerators the right way, the first time,
> actually sabotage the entire project?
>
> I poured 24 years into trying to work harder. I was frequently
> thwarted. Reducing the work schedule from four meetings per year to
> three didn't help anything. All I can do now is offer advice.
>
> *Disclaimer*
>
> The Numerical Algorithms Group Ltd is a company registered in England
> and Wales with company number 1249803. The registered office is: 30
> St. Giles, Oxford, OX1 3LE, United Kingdom. Please see our Privacy
> Notice <https://www.nag.co.uk/content/privacy-notice> for information
> on how we process personal data and for details of how to stop or
> limit communications from us.
>
> This e-mail has been scanned for all viruses and malware, and may have
> been automatically archived by Mimecast Ltd, an innovator in Software
> as a Service (SaaS) for business.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20211014/66131240/attachment.htm>
More information about the J3
mailing list