[J3] What are the acceptable value separators for different Decimal= specifier?

Malcolm Cohen malcolm at nag-j.co.jp
Tue May 27 04:52:23 UTC 2025


Hi Robert,

 

Oh, I think I see what Daniel was trying to say before.

 

But that is not a possible reading, as it says “*OR* a semi-colon”. The “or” means the blanks are always allowed.

 

The only thing is that it does not say clearly that comma is *not* allowed with decimal edit mode COMMA – allowing comma always is a more plausible reading (apart from not making sense), so it might be desirable to put “if the decimal edit mode is POINT” after the word “comma”. Technically not necessary as if there are two readings and one does not make sense, it is certainly the other one (the one that makes sense) that is meant.

 

I don’t think that using either-or for the comma/semicolon would be an improvement, at least grammatically.

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Robert Corbett via J3
Sent: Tuesday, May 27, 2025 11:42 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Robert Corbett <rpcorbett at att.net>
Subject: Re: [J3] What are the acceptable value separators for different Decimal= specifier?

 

All references are to J3/24-007.

 

You are reading the third sentence of paragraph 1 of subclause 13.11.4.1 in a way that was not intended.  The sentence was intended to say

 

   With the exception of adjacent undelimited

   character values,

 

   the values are separated

 

   by one or more blanks

 

   or by a comma, or a semicolon if the decimal

   edit mode is COMMA, optionally preceded

   by one or more blanks and optionally followed

   by one or more blanks.

 

With exception of adjacent undelimited

character values, a sequence of one or more

blanks serves to separate values.

 

The sentence could be made clearer.  An either-or clause is a possible improvement.

 

Bob Corbett





On May 26, 2025, at 6:12 PM, Daniel Chen via J3 <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> > wrote:

 

Hello,
Consider the following code:
```
      real :: rlarr(5) = (/1.,2.,3.,4.,5./)

      character(80) :: buffer_comma(3)

      character(80) :: buffer_point(3)

      character(80) :: buffer_none(3)

 

      namelist /nml_r/ rlarr

 

      buffer_comma = (/"", "", ""/)

      write(buffer_comma,nml_r,decimal='comma')       ! Case Comma

      write(6,*) buffer_comma

 

      buffer_point = (/"", "", ""/)

      write(buffer_point,nml_r,decimal='point')       ! Case Point

      write(6,*) buffer_point

 

      buffer_none = (/"", "", ""/)

      write(buffer_none,nml_r)                        ! Case None

      write(6,*) buffer_none

      end
```

What are the acceptable outputs for the 3 different cases?

For Case Comma, I would think the only acceptable output is something like the following with `;` as the value separator.
```
&NML_R  RLARR=1,000000000; 2,000000000; 3,000000000; 4,000000000; 5,000000000           /
```

For Case Point, I think the following should be good with `,` as value separator
```
&NML_R  RLARR=1.000000000, 2.000000000, 3.000000000, 4.000000000, 5.000000000           /
```
But would a `blank` value separator also acceptable? It seems so as I couldn’t’ find anywhere in the standard that disallows it.
```
&NML_R  RLARR=1.000000000 2.000000000 3.000000000 4.000000000 5.000000000           /
```

For Case None, the same question as Case Point.

Thanks,
Daniel

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


More information about the J3 mailing list