Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Depurating tool

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

Hello,

   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 Remove_Thisdbailey.co.uk> schrieb im Newsbeitrag news:euvma8$ddt$1 at smc.vnet.net...
> 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
> http://www.dbaileyconsultancy.co.uk
>


  • 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