MathGroup Archive 1998

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

Search the Archive

RE: replacement rules in packages



When creating a package file, make sure you make the proper calls to the
packages you need.

For instance, in your notebook (that you mention to work correctly), you
make an explicit call to TrigFit.

If you want to make it a package, either make the call in the public
part, or make it in the private part:

BeginPackage["foo`"]
myfunc::usage="what you want."
Needs["TrigFit`"] (*And make SURE Mathematica can find the path to
TrigFit*) Begin["Private`"]
etc

Or
BeginPackage["foo`"]
myfunc::usage="what you want."
Begin["Private`"]
Needs["TrigFit`"] (*And make SURE Mathematica can find the path to
TrigFit*) etc

The second case prevents a call to the TrigFit package from the global
context (if not defined elsewhere).

Hope this helps,


----------------------------------------------- Jean-Marie THOMAS
Conseil et Audit en Ingenierie de Calcul www.cybercable.tm.fr/~jmthomas
------------------------------------------------


-----Message d'origine-----
De:	Silvia Heubach [SMTP:silvi@cinenet.net] Date:	mardi 3 mars 1998
05:11
A:	mathgroup@smc.vnet.net
Objet:	[mg11235] replacement rules in packages

My problem lies with replacement rules in packages. I have created
functions that use replacement rules both to utilize option arguments
as well as to get parameter values from built-in functions that have
answers in the form {a -> 20, b -> 30}. If I test my function in a
plain notebook, all is fine. If I make it a package following all the
info I found in Maeder, Tam, and others, it does not work. This has
happened twice to me recently, and the problem seems to lie with the
repalcement rules in the package. I have attached three files:

sinefit2.nb  - the function in a notebook, where it works fine TrigFit.m
- the package version
trial.nb 	- a notebook to check the package - lots of error messages

I am at the end of my wits - does anybody know how to fix this problem?

Please email me at silvi@cinenet.net  or if you use reply, make sure to
take out the nospam.

Thanks a lot

Silvia




  • Prev by Date: RE: Mathematica graphics to AutoCad?
  • Next by Date: Re: Copying from Excel 97
  • Prev by thread: Re: replacement rules in packages
  • Next by thread: Mathlink slowdown with Win-NT