Caching working data



Robert Dodier <robert.dodier at gmail.com> writes:
> On 2012-07-26, Rupert Swarbrick <rswarbrick at gmail.com> wrote:
>
>> One option would be to stick it in SG itself, in the CAR say, so it
>> doesn't get printed.
>
> I don't think there's any guarantee that car flags are preserved, so I
> don't recommend that. Also you can't really work with car flags in
> Maxima.
>
>> If I can't depend on this behaviour, another option would be storing
>> some dictionary keyed by generator and relation lists with EQUALP.
>
> My advice is to attach the cache to the operator.  Then the code which
> fetches or creates cache values can inspect the operator of an input
> expression to find the cache. How about the following. (Code for
> make_hash is shown in the PS.)

Cool, thanks for the help. Since I'm writing this in lisp, I'll probably
go via a defvar with a hash table in it, but it's basically the scheme
you propose. I won't worry about the memory leaky bit for now.

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120727/154b5aae/attachment.pgp>;