Re: overloaded cant be distinguished by return values?



On May 30, 9:17 am, Richard Edgar <r...@xxxxxxxxxxxxxxxxx> wrote:
Michael Metcalf wrote:
"Berthold "Höllmann"" <berth...@xxxxxxxxxxxxx> wrote in message
news:seodk2la4b.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to distinguisch overloaded functions by their result value
but get an error message from ifort 9.1:

The message is correct. Overloaded procedures are disambiguated according to
their arguments ("Fortran 95/2003 Explained", Section 5.18).
Regards,

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. This is why

REAL :: a
a = 1/2

results in a being set equal to zero.

I don't quite understand this interpretation. There doesn't appear to
me that there is anything on the left hand side to be "evaluated". It
simply says "set variable (a) equal to something" (that must be
evaluated). I wouldn't necessarily expect it to look at the left hand
side to determine whether the variable is real or integer before
deciding how to evaluate the RHS. It would appear that Fortran does
what I would consider to be the "natural thing".


Richard


.



Relevant Pages