[J3] What are the acceptable value separators for different Decimal= specifier?
Robert Corbett
rpcorbett at att.net
Tue May 27 02:41:48 UTC 2025
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> 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/20250526/fa3e2e31/attachment-0001.htm>
More information about the J3
mailing list