[J3] Can elemental procedure have no dummy arguments?
Malcolm Cohen
malcolm at nag-j.co.jp
Sun Apr 29 20:03:58 EDT 2018
>For the case of an elemental with no arguments, the only “use” is a “stupid" one.
Not more than other cases.
The case of no effective arguments can occur without the compiler even being aware of it – viz all the arguments are optional, and the actual arguments that occur happen to be optional dummy arguments which are absent.
Anyway, as it happens, elemental procedures were added to Fortran 95 without any requirements or even semantics for when all the arguments were absent, and there was a big interp about it. This is emphatically NOT the case that someone added a cute generalisation without any use, this was discussed at considerable length through the interp process. Now maybe we got it wrong all those years ago, but “I don’t like this feature and it’s useless” is a weak argument for deleting it.
BTW there are other permitted side-effects, not just ERROR STOP. For example, setting IEEE flags. That one compiler deletes an elemental call does not mean that it is actually allowed to do so in all situations.
Cheers,
--
............................Malcolm.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20180430/39bc9965/attachment.html>
More information about the J3
mailing list