Re: How to detect NULL input?





glen herrmannsfeldt wrote:

Richard E Maine <nospam@xxxxxxxxxxxxx> wrote:

Rich Townsend <rhdt@xxxxxxxxxxxxxxxxxxx> wrote:


Fair enough. BTW, was result primarily introduced to support recursive

functions?



That's my impression. It was introduced in f90, before I was on J3, and
I don't recall ever explicitly asking, but I would assign a reasonably
high degree of confidence tothat guess.


In the early days of Fortran, when all variables were static
including the function return value, I could see the problem.

Is there a requirement that the function return variable be
static in versions allowing recursion?

I think the problem is with recursive functions that are also array valued. What does func(3) = func(3) + 1 mean if func is array valued?

I'm pretty sure there is no requirement that anything in
Fortran be static.  Heck, there's not even a requirement
that processors have memory ;).  That's merely an easy
way to do things.  It's hard to imagine how a static
requirement could apply to recursive functions.  Each
instance needs to do it's own computation and have a place
to return it's result value.

*** Hendrickson

It is more consistent with other languages not to need to assign to a variable named after the function.

Also, there is a tradition (in the case of ENTRY) that all function
return variables are EQUIVALENCEd.  Does it still do that, even
in the case of recursive functions not using a function return variable?

-- glen

.