[J3] Generic interface for IEEE_SELECTED_REAL_KIND?

Malcolm Cohen malcolm at nag-j.co.jp
Wed Jan 2 21:18:45 EST 2019


I wrote:
>Again, the compiler magic required to
> make it work is trivial, viz it is exactly what is already needed
> for SELECTED_REAL_KIND.

Steven Kargl complains:
>Yes, compiler magic will have to happen. The magic required
>for IEEE_SELECTED_REAL_KIND is neither trivial nor exactly like
>SELECTED_REAL_KIND.

As the function is identical in characteristics, behaviour, and results to SELECTED_REAL_KIND on an IEEE machine (most of them these days), methinks thou dost protest too hard.

I find it hard to believe anyone can seriously think that this is non-trivial.  Just wait ‘til you see the rest of the intrinsic module procedures! Very many of them indeed require special treatment, some of it quite complicated.

>J3 could/should have avoided the ambiguity by providing an interface that can actually be written as a module procedure

I don’t see why this is particularly desirable.  Being an intrinsic module procedure instead of an intrinsic procedure is just simple namespace handling, there’s little if any additional complication (in fact with some compiler technologies the intrinsic module procedures are easier, not harder, to implement).  One might as well complain that the intrinsic procedures should have had user-writable interfaces too, and that is an interesting philosophical position, but was not considered to be very pragmatic at the time. (My personal view at the time was that indeed it would have been better for them to satisfy the interface rules if possible, but that view was not very widely held, and would admittedly have been very difficult in 1990.)

Anyway, consistency with SELECTED_REAL_KIND is IMNSHO preferable to complying with an unnecessary philosophical rule, especially for a procedure that needs special handling (requiring that the compiler “know” what it is).

Cheers,
-- 
...........................Malcolm.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20190103/63e418b3/attachment.html>


More information about the J3 mailing list