Re: Debugging Mathematica Code (Mathematica 7)
- To: mathgroup at smc.vnet.net
- Subject: [mg95534] Re: Debugging Mathematica Code (Mathematica 7)
- From: "m.g." <mg at michaelgamer.de>
- Date: Wed, 21 Jan 2009 06:44:09 -0500 (EST)
- References: <gl1okn$dpb$1@smc.vnet.net> <gl4a7r$gi7$1@smc.vnet.net>
On 20 Jan., 12:57, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de> wrote: > Hi, > > the Wolfram Workbench has an excellent debugger > and there are situations where you need it. > > BTW: What is so complicated ? > - go to the Evaluation Menu and open the Debugger > - now type into a notebook > > foo[0] = 1 > foo[n_Integer] /; n > 0 := n*foo[n - 1] > > use the mouse and mark in > foo[n_Integer] /; n > 0 := n*foo[n - 1] > the "foo[n - 1]" expression. > > Go to the debugger window and use > "Break at selection" Now the "foo[n - 1]" > has a red frame. > > Finally go to the notebook window and enter > > foo[4] > > as an input. And ... ta ta ta > The Stack window show the stack > and all is as it should. Now press "Continue" > ind the debugger menu to see the next > step in the recursion ... > > Regards > Jens > > magma wrote: > > No, there isn't a decent explanation. > > You can check prior posts by me and others on debugging, but this is > > the conclusion, basically. > > Anyway, the general feeling among knowledgeable users is that you do > > not really need a debugger. > > These users just sprinkle print statements here and there to see > > intermediate results. > > I additionally also use On[] and Off[] which help me see clearly the > > code flow. > > You don't really need much more. > > > hth > > > On Jan 19, 12:36 pm, "m.g." <m... at michaelgamer.de> wrote: > >> Hello Experts, > > >> I made my fist steps with the Mathematica (so called) debugger and= st= > > umbled > >> immediately. Is there anywhrere a documentation of this tool that is > >> worth it's name (a criterion which the Mathematica 7 documentatin on d= ebu= > > g > >> surely fails). I've tried a lot, but I'm still at the stage "trial an > >> error". > > >> Greetings > > >> Mike Hi Jens, thanks for the fast reply. I did exactly this what you described, but: Sometimes it works, sometimes not. I used "step" and "step in", to see waht the code does, but it seems that frequent swithceing breakpoint on and of "irritates" the debugger and it's behavior gets a bit, say, probabilisitc, and therefore I was looking for documentation (for it could be my fault in missusing the tool without knowing there is a missuse). So I returned to the insertion of Print-Statements. But I would like more to have a debugger which works well - it's more easy and comfortable like the print-statement workaround. Greetings Mike