|
From: Raymond T. <toy...@gm...> - 2024-10-11 14:14:55
|
On 10/11/24 6:59 AM, Eduardo Ochs wrote: > Hi all, > > in other recent threads we saw that this > > P(t) := [cos(t),sin(t)]; > draw2d(parametric(P(t)[1], P(t)[2], t,0,10)); > > works but this > > P(t) := if t <= 6 then [t,4] else [6,10-t]; > draw2d(parametric(P(t)[1], P(t)[2], t,0,10)); > > fails, and yields this error: > > draw2d (parametric): non defined variable > > I am learning Sly, that is a fork of Slime, and I just had some ideas > for experiments that I would like to do by modifying temporarily the > Lisp code around the call to listofvars that returns, ahem, "the wrong > answer". But I need help with one basic thing: how do I tell Slime/Sly > to enter the debugger when that error is raised? One thing is to start maxima with the |-g| option. There was also another variable that caused the lisp debugger to invoked on errors, but I can’t remember what it is; I rarely use it. What I end up doing is doing |debugmode(true)| and run the command again. When I enter debug mode, I press Ctrl-C and get dropped into the debugger. But you don’t need to do this to test out code. Just use Sly (Slime) to compile the new code and run it. Or just stick a |(break)| in the code just after or before the call to |listofvars|. Or if your |trace| function supports a |:break| option like cmucl and sbcl, use that to cause a break when |listofvars| is traced. |