MathGroup Archive 1999

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

Search the Archive

Re: Help: Debuging Functions in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16918] Re: Help: Debuging Functions in Mathematica
  • From: Harald Giese <giese at dkrz.de>
  • Date: Thu, 8 Apr 1999 02:32:31 -0400
  • Organization: Institut fuer Meereskunde, Universitaet Hamburg
  • References: <7e1ceb$bbk@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Boris Breznen wrote:
> ...
> When you write a function in Matlab, you save it to a text file with
> extension .m and then simply type the name of the file (function)
> at the Matlab prompt to use it. When
> you make changes in the source code you type "clear myFunction"
> at matlab prompt, which removes the function definition and then
> re-type the function name again. As simple as it gets ...
> 
> Now, how do you do the same thing in Mathematica ? I have
> a function that I saved in a package format. The directory
> that contains the package is part of the $Path. When I put
> Needs["myFunction`"] in a notebook the function works fine.
> But now I want to change the source code. I edit the package,
> go back to the notebook type Remove[myFunction] and at that
> point Mathematica refuses to read the function again. Doesn't
> matter if I use Needs, or <<, Mathematica doesn't re-load the
> function. How the hell do you do this trivial task ?
> ...


Boris,

A Mathematica-Package is a library, not a worksheet. 
For developing things, you should use the notebook frontend.
There you can write your functions, debug them, rewrite them (using
Remove[]) and save the result. After everything works fine then you can
create a package.



Regards,
Harald

-- 
Harald Giese
Email: giese at dkrz.de
Phone: +49 (0)40 4123 5796; Fax: +49 (0)40 5605724
Institut fuer Meereskunde der Universitaet Hamburg
(Institute of Oceanography of the University of Hamburg)
Troplowitzstrasse 7, D-22529 Hamburg


  • Prev by Date: Re: Help needed with List!
  • Next by Date: Re: How to interrupt a running evaluation in MathLink
  • Previous by thread: Re: Help: Debuging Functions in Mathematica
  • Next by thread: Q: LinkInterrupt[link]