Package writing

*To*: mathgroup at smc.vnet.net*Subject*: [mg67223] Package writing*From*: "marek" <MarekBr at gmail.com>*Date*: Tue, 13 Jun 2006 01:07:15 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Hello All I have the following problem. I used Template.nb to create a package. During the whole process I had some problems trying to get it to work although the same commands in a different (fresh/new notebook) produced desired results. Right now the sutuation is as follows. I can use my poackage if I load it into any notebook but it does not work in the original notebook I used to write it. I have that notebook and the associated m file in /home/marek/Mathematica/Packages. Here are first 4 command I execute in the original notebook 1. SetDirectory["/home/marek/Mathematica/Packages"] This sets my working directory to the directory in which my package is located. 2. AppendTo[$Path, "/home/marek/Mathematica/Packages"]; Here I append this very same directory to my search path so that I can load that package in the same notebook for testing purposes. 3. Needs["DataAnalysis`"] This line loads that package. When I execute that line I get no complaints form Mathematica that it cannot open something or anything like that After those there is a bunch of cells with the implementation of my ppackage all of which are set to be an Initialization cells. After them I have few cells which are using functions from my package but they do not work. The symbols/functions defined in that package seems to be recognized because Ctrl=k combination does the autocomplition but nothing happens when I execute a cell with a funcion defined in my package. On the other hand I can copy my package to /home/marek/.Mathematica/AutoLoad directory (and I do it changing the name of that m file) and it works fine from there after I open new notebook and load it with Needs["DD`"] (I chnaged the name of that file to DD.m) In a fresh notebook I can execute that AppendTo command from above and then load my package from the original development directory (it has different name there so I know that it is that version which is being loaded not the one from /home/marek/.Mathematica/AutoLoad) and it will work fine. So why I cannot use my package from the original notebook I wrote it in? Any suggestiones greatly appreciated Marek