MathGroup Archive 2000

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

Search the Archive

Re: 2nd arg to BeginPackage

  • To: mathgroup at
  • Subject: [mg24770] Re: 2nd arg to BeginPackage
  • From: Jens-Peer Kuska <kuska at>
  • Date: Thu, 10 Aug 2000 00:31:51 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <8mr1c5$>
  • Sender: owner-wri-mathgroup at


since the Statistic contex does not introduce any symbols.
You must give the correct context that add symbold for
CDF[] this is "Statistics`Common`DistributionsCommon`"
for NormalDistribution[] this is "Statistics`NormalDistribution`"

    "TestPkg`", {"Statistics`Common`DistributionsCommon`", 

ff::usage = "Some function that uses CDF."


ff[a_] := CDF[NormalDistribution[0, 1], a]
End[];   (*Private context*)


and all works fine

?? ff

Some function that uses CDF.

ff[TestPkg`Private`a_] := CDF[NormalDistribution[0, 1],


Daniel Reeves wrote:
> My first question is, there seems to be a discrepancy between the
> documentation for BeginPackage:
>   BeginPackage["Package`", {"Needed1`", "Needed2`", ...}]
> vs how standard packages use it:
>   BeginPackage["Package`", "Needed1`", "Needed2`", ...]
> My next question is, why doesn't either form do what I expect here:
> BeginPackage["TestPkg`", "Statistics`"];
> ff::usage = "Some function that uses CDF."
> Begin["`Private`"];
> ff[a_] := CDF[NormalDistribution[0,1], a]
> End[];   (* Private context *)
> EndPackage[];
> In the definition of ff, it thinks the context for CDF (and
> NormalDistr) is TestPkg`Private` instead of Statistics`...
> How can I avoid spelling out the contexts for things like CDF?
> Thanks a lot,
> Daniel Reeves

  • Prev by Date: Re: Re: Correlation function and data
  • Next by Date: Re: extract style sheet from nb w/ private style sheet
  • Previous by thread: 2nd arg to BeginPackage
  • Next by thread: Re: 2nd arg to BeginPackage