Re: How to make Package?
- To: mathgroup at smc.vnet.net
- Subject: [mg19964] Re: How to make Package?
- From: Martin Kraus <Martin.Kraus at informatik.uni-stuttgart.de>
- Date: Thu, 23 Sep 1999 23:26:16 -0400
- Organization: Institut fuer Informatik, Universitaet Stuttgart
- References: <7s79h3$htu@smc.vnet.net> <7sa39e$ma4@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jens-Peer Kuska wrote: > > Hi Dana, > > it is up to you. You can write the source of the package with a simple > ASCII editor or with the FrontEnd. The FrontEnd is nothing else than a > word processor (with some special functions). > > You may look at the packages that come with Mathematica. > The older packages are written as plain ASCII files and placed > in the directories AddOns/StandardPackages/... > > Some newer (namely the Notation package) are written and explained in a > Notebook. There you can mix formulas, explanations of your code ... with > the package definitions. For the "working only" case you can simply save > the package and load you definitons without the "explanation overhead". > > Hope that helps > Jens > Jens is right, but I would like to add the following: As far as I know things are different for the student version of Mathematica 4: The student version will write a special type of packages (.mx) which is intentionally incompatible with the non-Student version of Mathematica. (See http://support.wolfram.com/Systems/Student/Differences.html) Also, writing packages in Mathematica 3 is a pain because of the bugs in the Front-End (at least that's my experience on a Mac). Mathematica 4 is much better in this respect. Though, once I used the Save As Packages command, Mathematica had problems writing the package (the .m file was corrupted). Mathematica reported about this problem. However, in my panic I saved the notebook (which was also corrupted at that point) and, therefore, overwrote the (probably) intact version of the notebook on the hard disc. Thus, I lost one days works (luckily I had a backup from the day before). The big advantage of writing a package with Mathematica 4 is the bracket highlighting. (However, many word processors can do that also.) Considering all this, my recommendation is the following (which is what Roman Maeder also recommends in one of his books): Develop the package as a set of functions within Mathematica (without the context stuff) and when it is (almost) finished, put it into a word processor (Save as Text) and do the final editing there. Greetings Martin