Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Follow up to writing a package.' topicStudent Support Forum > General > "Follow up to writing a package."

Next Comment >Help | Reply To Topic
Author Comment/Response
Rob Gross
07/23/99 11:33am

I posted a message a few days ago about package writing. Well, I've experimented some more, and now I am even more puzzled. When reading the Mathematica book I found a package with a similar format as the package I was trying to test it out. This is the package from the book:

BeginPackage[''test2`'', ''Statistics`ConfidenceIntervals`'']

myMeanCI::usage = ''myMeanCI[list] gives my value for MeanCI.''

Begin[''`Private`'']

myMeanCI[list_] := MeanCI[list, KnownVariance -> 1.]

End[ ]

EndPackage[ ]

When I loaded this package, their were no conflicts and when I typed ?MeanCI, I got:

In[7]:=
?MeanCI

''MeanCI[list, options] returns a list {min, max} representing a confidence \
interval for the population mean, using the entries in list as a sample drawn \
from the population.''

Which is what is supposed to happen- it's supposed be given the definition assigned to it in the add on package.

My test package is this:

BeginPackage[''testpackage3`'', ''Calculus`DiracDelta`'']

Begin[''`Private`'']

us[x_]:= UnitStep[x]

End[ ]

EndPackage[ ]

When I load this, I get this message:

In[1]:=
<<Mine`testpack3`
UnitStep::''shdw'':
Symbol UnitStep appears in multiple contexts
Calculus`DiracDelta`, Global`; definitions in context
Calculus`DiracDelta` may shadow or be shadowed by other
definitions.

In when I type ?UnitStep, I get:

In[2]:=
?UnitStep
''Global`UnitStep''

What is the difference between both of these packages that would produce one that works properly and one that does not? I do not see any differences. Both of these packages are in initilization cells by the way. Someone please tell me- this is incredibly frustrating.

URL: ,

Subject (listing for 'Follow up to writing a package.')
Author Date Posted
Follow up to writing a package. Rob Gross 07/23/99 11:33am
Re: Follow up to writing a package. Forum Modera... 07/28/99 11:35am
Re: Follow up to writing a package. Rob Gross 07/30/99 2:50pm
Re: Follow up to writing a package. Forum Modera... 08/10/99 05:28am
Next Comment >Help | Reply To Topic