Attributes

Alaric B. Williams alaric@abwillms.demon.co.uk
Thu, 18 Sep 1997 11:56:46 +0000


> > Ah, well - but a function that "leaves a record" would surely still 
> > be pure,

> I don't see that.  If the function leaves a record then that record must
> have some use, and thus the function cannot be memoized.

Memoisation would affect that record, yes, but we may not care about 
this logging behaviour being deterministic. If all we need to know is 
that the function has been called at some point, ie it sets a flag, 
then memoisation isn't a problem.

> However, from what I understand, I/O is considered a non-functional
> process.  This makes sense, since IO changes at least the coordinates of
> the cursor in a global way.

Yes, but that's not what I was angling at!

> >From another point of view, purity is a characteristic of the system, not
> the function itself; most modern systems consider only the function's
> return value when memoizing.  What if the function's entire output were to
> be memoized, and entire input considered?  From this point of view the
> whole discussion is silly, since everything (everything that Science knows
> of, that is) is a pure function, with a unique cause and effect. Of
> course, this point of view is useless for all practical purposes...

Not necessarily; a state monad or something like that is about that 
kind of thing. That's a very vague statement because it's meant to 
cover a lot :-)

> apparently I just like to hear the sound of my own fingers hitting the
> keyboard.  Oh well.

?

> -Billy

ABW
--
Alaric B. Williams Internet : alaric@abwillms.demon.co.uk
http://www.abwillms.demon.co.uk/