[log in to unmask] wrote:
> James Giles wrote:
>
>> [log in to unmask] wrote:
>> ...
>>> OTOH, we could extend the syntax of the kind thing-o in a literal to
>>> allow initialization expressions instead of names. One could then
>>> write something such as 0.1_real_kinds(1) to get default real and
>>> 0.1_real_kinds(2) to get double precision.
>>
>> I really dislike that one. This thread began with the observation
>> that literals with KIND specifiers are illegible and error-prone
>> and now has lead to an extension of that very feature which is less
>> legible and more error-prone. Tragic irony?
>
> The key word is ALLOW. Notice it doesn't say REQUIRE.
As soon as something is allowed, codes using it will exist. The ivory
tower attitude that "if you don't like feature x, don't use it" simply
*never* applies. As soon as you allow somthing like that, programs
abusing it will illegibly clutter up programming environments
everywhere.
> 1. The standard also specifies scalar named constants for the four
> default kinds (and for double precision real) in ISO_FORTRAN_ENV,
> 2. The standard allows initialization expressions for kind specifiers in
> literals (actually, <primary> would be better), or
> 3. Expect the user to invent scalar names and give them values in named-
> constant declarations.
I notice that the best solution still isn't on your list:
4. provide a way to write code that doesn't need KIND
specifiers on literals in the first place.
--
J. Giles
|