[J3] Comments in list-directed input?

Van Snyder van.snyder at sbcglobal.net
Thu Aug 4 20:11:12 UTC 2022


On Thu, 2022-08-04 at 18:28 +0000, Bleikamp, Richard via J3 wrote:
> [AMD Official Use Only - General]
>  
> Hi Van,
>  
> A non-delimited character value, in list-directed input records, can
> currently be a single “!”, or “!xxx” where “x”s are rep-chars.  “!”
> is a valid rep-char.  So, allowing a “!” to initiate a comment-to-
> end-of-line would introduce an incompatibility with Fortran 2018/…

I had in mind NOT introducing an incompatibility. Something like

   "! not within a non-delimited character value introduces a comment."

Maybe a NOTE "Watch out! That thing that looks like a comment might be
part of a non-delimited character variable's input value!" would be
appropriate too.

> If we were to introduce a new mode for list-directed input, where all
> character values were required to be delimited with ‘ or “, then we
> could easily support ! comments in those records.  
>  
> Unless we were going to eventually obsolete list directed input of
> non-delimited character values, I wouldn’t be thrilled with adding a
> new mode.
>  
> Rich
>  
> From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf OfVan Snyder
> via J3
> Sent: Wednesday, August 3, 2022 11:54 PM
> To: j3 <j3 at j3-fortran.org>
> Cc: Van Snyder <van.snyder at sbcglobal.net>
> Subject: [J3] Comments in list-directed input?
>  
> [CAUTION: External Email] 
> We allow comments in namelist input.
>  
> In list-directed input, one can put comments after the last item
> desired by putting them after the slash that terminates the input.
>  
> If one is reading several arrays, say one array per line, with one
> list-directed input statement, one cannot put a slash and comment on
> each line because that terminates the input.
>  
> Would there be a problem to allow comments in list-directed input,
> beginning with "!" as in namelist input?
>  
> Is this a tiny enough change to get added to the "really tiny stuff
> tacked onto the next standard outside the big projects" list?
>  
> As is the case with the slash, if one is reading a character
> variable, and not including quotes or apostrophes, you risk reading
> the comment.
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20220804/54ebc79d/attachment-0001.htm>


More information about the J3 mailing list