Re: overloaded cant be distinguished by return values?
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Wed, 30 May 2007 12:01:16 -0800
Reinhold Bader wrote:
Richard Edgar wrote:
Being more general (please correct me if I'm wrong...), this is an
example of the rule in Fortran that the RHS of any expression is
evaluated before the LHS is considered.
If I've understood it correctly, it is simply a case of a function
result not being a dummy argument, although in some respects it may
behave similar to one with intent(out). In particular, the function
result object is short lived in that it ceases being defined once the
assignment to the LHS at call is performed.
The function result is converted to the type needed in the expression
where the function is called. It is a one way path from the function
result type to the expression and not the other way around.
In some cases the function call is implemented by passing an additional
argument to the function, such that the return value is stored in
that argument. The passed argument corresponds to the known function
return type, not the other way around.
It might be possible to define a language that did function
calls differently, but that is not Fortran nor any of the other
popular languages. There are many cases where the function
return type is not known in the way needed to resolve
generic function calls.
-- glen
.
- References:
- overloaded cant be distinguished by return values?
- From: Berthold Höllmann
- Re: overloaded cant be distinguished by return values?
- From: Michael Metcalf
- Re: overloaded cant be distinguished by return values?
- From: Richard Edgar
- Re: overloaded cant be distinguished by return values?
- From: Reinhold Bader
- overloaded cant be distinguished by return values?
- Prev by Date: Fortran assumed-shape array problems with MPI
- Next by Date: Re: overloaded cant be distinguished by return values?
- Previous by thread: Re: overloaded cant be distinguished by return values?
- Next by thread: Re: overloaded cant be distinguished by return values?
- Index(es):
Relevant Pages
|