memoizing in mathematica vs macsyma..



> I wanted to keep as much useful information as possible, ie. when a
> single thing of the graph is changed, not everything has to be
recomputed
> and the like. The difficulty I encountered was where to store this
> information

The basic issues in the ratdisrep case are mutable objects and global
flags.  If your representation is not mutable, and does not depend on
global flags, things should be simpler.  Once you have those
complications, then you need a fairly elaborate system to keep track of
dependencies, and also to allow outdated information to be discarded
(garbage collected).

And in fact mutability is not so bad as long as your package is
responsible for all mutations.  If, on the other hand, you have embedded
MLists in your representation which are visible to the user, then things
get complicated.

Part of the problem is that Maxima doesn't have any generic way of
supporting opaque objects, and in fact does an uneven job of handling
the specific ones it has.  Rat and Bigfloat are pretty consistently
handled correctly.  There are a few bugs with MRat, and many more with
MPois.  The continued fraction (CF) representation doesn't even try to
be opaque.  Adding a new opaque representation is a major project, and
it shouldn't be.

Some sort of object system would be a good thing, but the danger here is
building something too elaborate....

    -s