MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Depurating tool

  • To: mathgroup at
  • Subject: [mg74777] Re: Depurating tool
  • From: "Michael Weyrauch" <michael.weyrauch at>
  • Date: Thu, 5 Apr 2007 04:05:38 -0400 (EDT)
  • References: <eunqjk$88f$> <euvma8$ddt$>


   well, it depends. Print statements are very useful at times.

But recently I had the following problem when running my own Mathematica package (about 20
printed pages) with parameters not yet well tested.  Mathematica announced with a message that
I had called First[  ] with an empty list somewhere. Unfortunately, there are about 100 First statements in my package
scattered around in the code. 

Of course, I could change the internal command First[ ] in such a way that it always  prints the list I give as a parameter
and could then sift through the probably lengthy output to find an empty list. No question that would work.

But I find it much more convenient to set a message breakpoint on First in Wolfram Workbench, and then
by debugging session exactly shows me the location in my code where I called First[] with an empty list.

I like the old fashioned and simple solutions, but at times the more modern methods are to be preferred.

Regards   Michael Weyrauch

"David Bailey" <dave at> schrieb im Newsbeitrag news:euvma8$ddt$1 at
> Miguel Gil wrote:
>> I want to locate my errors as soon as possible and then to correct it.
>> When the package is enough big, the location and correction is very tedious.
>> Does there exist a tool to depurate my packages.
> I assume you mean a debugger!
> As has already been explained, you could use the Wolfram Workbench. 
> However, like to debug Mathematica (and other) code using added Print 
> statements.
> OK, I am probably a bit of a Luddite, but I find that this is often 
> easier - particularly if the code in question is recursive.
> David Bailey

  • Prev by Date: Re: Question
  • Next by Date: Re: Integral of Piecewise function involving DiracDelta
  • Previous by thread: Re: Depurating tool
  • Next by thread: Re: Which Mathematica product