From: young@purdue.edu (Michal Young)
Subject: Re: how pure are functions?
Date: 7 Apr 92 19:05:13 GMT [thread overview]
Message-ID: <18363@ector.cs.purdue.edu> (raw)
In reply to:
> Are they free from internal state?
>No.
Mark Biggar says:
> More then likely that variable is only visible in the body of the package
> that defines the function and so is invisible to the user of the function,
> but strictly the function itself has no "internal" state.
This is true, strictly speaking, but from the viewpoint of a user,
verifier, or compiler, Ada functions do not appear to be stateless.
For instance, one cannot generally substitute 2*f(x) for f(x) + f(x).
There are good practical reasons for not insisting that every
"function" be a pure function, but it would be quite helpful if the
language provided some way to indicate that certain "functions" were
actually functions in the mathematical sense.
--Michal Young
--
Michal Young
next reply other threads:[~1992-04-07 19:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-04-07 19:05 Michal Young [this message]
-- strict thread matches above, loose matches on Subject: below --
1992-04-09 14:20 how pure are functions? P. Singleton
1992-04-07 17:13 Mark A Biggar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox