On 2013-02-08, Henry Baker <hbaker1 at pipeline.com> wrote:
> the assume database needs to be able to be easily extended &
> contracted in a manner similar to a Lisp "a-list".
>
> Thus, we would like to do something like the following:
>
> (let ((new-db (extend-db ***newassumptions*** ***existingdb***)))
> ... evaluate expressions in context of new-db ...
> )
>
> After the end of the "let" expression, we're back to using the
> ***existingdb***, and "new-db" disappears & is garbage-collected.
Maxima's context system handles that, at least for stuff asserted via
'assume'. (That's separate from stuff asserted via 'declare'. Of course,
it would be better to unify the two.)
E.g. something like:
foo_context : newcontext (gensym ());
assume (<this>, <that>, <etc>);
<stuff>;
killcontext (foo_context);
There isn't any similar mechanism for 'declare'.
best,
Robert Dodier