[J3] Are the parentheses really necessary for an unlimited format item?
Malcolm Cohen
malcolm at nag-j.co.jp
Sat Aug 21 03:32:04 UTC 2021
With the current description of how things work, yes they are necessary.
I do not see a compelling reason to omit the parentheses, and although the cost may be small, it does not have zero cost for the committee, for users, for teachers and book writers, or compiler writers.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Van Snyder via J3
Sent: Saturday, August 21, 2021 11:06 AM
To: j3 <j3 at j3-fortran.org>
Cc: Van Snyder <van.snyder at sbcglobal.net>
Subject: [J3] Are the parentheses really necessary for an unlimited format item?
It seems that the parentheses aren't really necessary for an unlimited format item, so long as <format-items> consists of one data edit descriptor. For example, *f7.3 or *g15.7 would not be ambiguous.
R1305 could be
R1305 unlimited-format-item is * ( format-items )
or * data-edit-desc
13.4p8 in 21-007 would need adjustment. Replace "rightmost parenthesis" with "end" and "leftmost parenthesis" with "beginning". This also eliminates the question whether, after reversion, the format item is still unlimited. Append "The file is not positioned in a manner identical with the way it is positioned when a slash edit descriptor is processed (13.8.2)."
C1303 could be eliminated if R1305 were
R1305 unlimited-format-item is * ( [ format-items, ] data-edit-desc [, format-items ] )
or * data-edit-desc
Given 13.4p8 it isn't really necessary for the syntax to require an unlimited format item to be the last thing. Having something after it is no different from having junk after the final right parenthesis in a format specification given by a character data object. Folding unlimited-format-item into format-items would allow nonsense like nested or repeated unlimited format items, but the specification in 13.4p8 would have exactly the same result as if unlimited-format-item were required to be the last thing. A kindly processor might issue a "Questionable: format items that appear after an unlimited format item are not processed" message.
Eliminate "or ( [ format-items, ] unlimited-format-item )" from R1301.
Eliminate R1303.
Replace R1306:
R1306 r is int-literal-constant
or *
Eliminate C1304 because int-literal-constant doesn't include a sign, so r must necessarily be positive.
Eliminate C1303.
Replace 13.4p8:
"When format control encounters the end of a format item in which the repeat specification r is an asterisk, control reverts to the beginning of that format item. This reversion of format control has no effect on the changeable modes (12.5.2)."
This change would not affect the semantics of a program that conforms to a8-007r1.
Maybe the simplification of syntax and constraints isn't enough to justify the change.
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/20210821/251f0f71/attachment.htm>
More information about the J3
mailing list