[Maxima] dynamically created symbol
macrakis at alum.mit.edu
Mon Jul 2 09:18:47 CDT 2012
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
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
> Maxima has both newcontext and supcontext--I would think that using
> supcontext should allow recursive contexts to work without a great deal of
> Also, the user documentation doesn't mention this, but I think newcontext
> and supcontext do not evaluate their arguments---likely you need something
> block([ctx : gensym("ctx")],
> ctx : apply('subcontext, [ctx]),
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima