newcontext/supcontext do evaluate their arguments -- try e.g.
newcontext(gensym("ctx")) -- but the whole thing is silly.
Sometimes you need to name contexts, but often anonymous contexts are fine.
It looks like in most cases, all you want is something like
with_local_context( ... ). Of course, this can be written as a Maxima
macro (::=) using supcontext, but if the most common use case is anonymous
contexts, Maxima should support them directly.
Imagine having to name variable contexts with unique names -- including
recursive ones!
-s
On Mon, Jul 2, 2012 at 10:06 AM, Barton Willis <willisb at unk.edu> wrote:
> Stavros Macrakis wrote:
>
> > Seems to me that this is a flaw in the context system -- it should not
> be necessary to go to such trouble to make recursive contexts work
> correctly.
>
> Maxima has both newcontext and supcontext--I would think that using
> supcontext should allow recursive contexts to work without a great deal of
> fuss?
> Also, the user documentation doesn't mention this, but I think newcontext
> and supcontext do not evaluate their arguments---likely you need something
> like
>
>
> block([ctx : gensym("ctx")],
> ctx : apply('subcontext, [ctx]),
> ...);
>
> --Barton
>
>
>
>
>
>
>
>
>
>