Re: Allow interspersed named and positional arguments?
- From: Paul van Delst <Paul.vanDelst@xxxxxxxx>
- Date: Tue, 27 Nov 2007 12:46:17 -0500
Beliavsky wrote:
In Fortran, all arguments in a call after the first named argument
must also be named, so that
subroutine foo(x1,x2,x3,x4,x5,x6)
! assume all arguments optional
...
call foo(a1,x3=a3,a4,x5=a5,x6)
is not allowed.
(I'll assume that's true... I didn't check the std)
I wish it were allowed,
Why?
with the interpretation that positional
arguments after named arguments are presumed to be the successive
arguments in the callee, until the next named argument appears, so
that the code above would be equivalent to
call foo(a1,x3=a3,x4=a4,x5=a5,x6=a6)
Then write it that way.
Making this change would not provide substantial new functionality,
but I think it would be convenient, and it does not seem too difficult
for compiler writers to implement.
I have no idea as to the ease or difficulty of implementing your suggestion (although I'd bet it's not as simple as it may seem :o), but even you state "[m]aking this change would not provide substantial new functionality".
So .... why do it? Is it *that* inconvenient to write "x4=a4" as opposed to just "a4"?
cheers,
paulv
.
- References:
- Allow interspersed named and positional arguments?
- From: Beliavsky
- Allow interspersed named and positional arguments?
- Prev by Date: is this newsgroup accessible via gmane
- Next by Date: Re: is this newsgroup accessible via gmane
- Previous by thread: Allow interspersed named and positional arguments?
- Next by thread: Re: Allow interspersed named and positional arguments?
- Index(es):
Relevant Pages
|
|