[J3] What are the acceptable value separators for different Decimal= specifier?
Daniel Chen
cdchen at ca.ibm.com
Tue May 27 13:46:35 UTC 2025
Thanks Malcolm and Robert!
I was also reading the same paragraph and came up with a different interpretation.
I had:
With the exception of adjacent undelimited
character values,
the values are separated
1. by one or more blanks
1. or by a comma,
1. 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.
I came up with 3 overrides both 1 and 2 so semicolon is the only valid value separator when the decimal edit mode is COMMA.
But it seems the intention is to:
a. allow blank as the value separator on all 3 cases in the code.
b. allow semicolon as the value separator on all 3 cases in the code.
b. disallow command as the value separator only when decimal mode is COMMA (i.e. other cases are allowed)
Is this summary correct?
Thanks,
Daniel
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of Malcolm Cohen via J3 <j3 at mailman.j3-fortran.org>
Date: Tuesday, May 27, 2025 at 12:52 AM
To: 'General J3 interest list' <j3 at mailman.j3-fortran.org>
Cc: Malcolm Cohen <malcolm at nag-j.co.jp>
Subject: [EXTERNAL] Re: [J3] What are the acceptable value separators for different Decimal= specifier?
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
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/53e74f8f/attachment-0001.htm>
More information about the J3
mailing list