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
>