[Maxima] find_root and variable capture?
macrakis at alum.mit.edu
Fri Mar 7 14:45:27 CST 2008
On Fri, Mar 7, 2008 at 2:29 PM, dlakelan <dlakelan at street-artists.org> wrote:
> I went through my entire script, and converted things like
> find_root(foo(bar,baz,quux),[bar,0,1]) into
> which seems to have solved some problems, and now my script can plot2d
> my function.
Glad to hear it!
I don't think, though, that you should have to write
I would think that
would work as well since foo(bar,baz,quux) will be evaluated in a
context where baz and quux are still bound to the correct values. It
would be different if you were *returning* the expression to an outer
level. Or if there is a true variable capture problem, that is,
interference between the internal variable names of find_root and baz
and quux. In that case, the problem should be fixed by changing
find_root's variable names to, e.g. fr_bar, fr_baz, etc. (yes, it
would be better to have static scope, but...)
More information about the Maxima