| Catherine Rees Lay 2005-11-18, 7:56 am |
| Ken Plotkin wrote:
> On Wed, 16 Nov 2005 13:33:01 +0000, Catherine Rees Lay
> <spamtrap@polyhedron.com> wrote:
>
>
>
>
>
> If you call a function, doesn't the calling program have to know the
> type of the function?
>
> I've blown things up more than enough times by forgetting to do that.
>
> Ken Plotkin
>
I think we're just using different words for the same thing...
PROGRAM MAIN
CALL SUB
END
SUBROUTINE SUB
INTEGER ANS, FUN
ANS = FUN(3)
END
INTEGER FUNCTION FUN(ARG)
INTEGER ARG
FUN = ARG*2
END
(Non I-N integer names used deliberately to force declarations, and
apologies for any typos)
The caller here is subroutine SUB which does indeed need to know the
type of the function - but the program is MAIN, and it doesn't.
Catherine.
|