[J3] Default values for optional arguments
Van Snyder
van.snyder at sbcglobal.net
Wed Jan 20 22:07:43 UTC 2021
On Wed, 2021-01-20 at 10:55 -0700, William Clodius via J3 wrote:
> 1. Having a default value means that the argument ia always
> present with a value so the present(argument) test is never
> appropriate. The easiest way to express this in standardess I believe
> is to forbid an argument from having both the optional and default
> attribute at the same time and requiring that actual arguments to the
> present function must have the optional attribute.
I don't see any conflict between OPTIONAL and having a default value.
It can still be useful to know whether an optional argument was
present, even if it has an optional value. That's definitely not a
problem as things are now, where one must explicitly create a local
variable in lieu of the dummy argument. I don't see why it's a problem
if the processor does it automagically.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210120/d6bd1407/attachment.htm>
More information about the J3
mailing list