Attributes
William Tanksley
wtanksle@ucsd.edu
Mon, 15 Sep 1997 20:55:49 -0700 (PDT)
On Mon, 15 Sep 1997, Alaric B. Williams wrote:
> > To confirm my understanding of purity, a function is pure if it only
> > performs actions necessary to its purpose. For example if a function is to
> > calculate a result, it doesn't also create a persistent variable somewhere
> > that remains when the function exits.
> Hmmm... I think that skirts the crucial point somewhat. Purity is
> sometimes the topic of flamewars, but the general idea is that this
> is not a pure function:
I had thought that pure functions were a fairly well defined concept, so
that a function is pure if and only if every call of it with identical
(formal) parameters will produce identical results.
Of course, this probably isn't correct, since this would allow a function
which only modified global variables (which would then be used by other
functions). So let's add the requirement.
> ABW
-Billy