On 2013-03-28, Rupert Swarbrick <rswarbrick at gmail.com> wrote:
> Once you've got hold of the $DIFF function, I'm also not sure that your
> two "eval" lines are going to work. You see, you haven't told the
> interpreter "I" to change the current package to MAXIMA. As such, I
> think that
>
> LispObject x = I.eval("'$x");
>
> will work by first reading the string "'$x" to the lisp form
>
> (QUOTE CL-USER::$X)
>
> and then evaluating, to get the symbol CL-USER::$X. However, you want
> the symbol MAXIMA::$X. Presumably the Interpreter object has a method to
> change package?
Oh -- good point. Actually I suppose that the problem is more likely
that I.eval("'((%SIN) $X)") interns %SIN in CL-USER and therefore it's
not recognized by $DIFF as the Maxima function 'sin'. Just guessing, I
haven't investigated it.
best
Robert Dodier