MathGroup Archive 2003

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

Search the Archive

RE: Namespaces/Context in Packages?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44822] RE: [mg44791] Namespaces/Context in Packages?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 3 Dec 2003 04:24:04 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Marko,

You must be working in some Version 4 because in Version 5 Mean is in
Mathematica proper.

For Version 4 Mathematica is playing a trick on you. One that is easy to
fall into.

Needs["Statistics`ContinuousDistributions`"]

Context[Mean]
Statistics`DescriptiveStatistics`

Mean is in a different package, probably because it is common to several
packages. So name Statistics`DescriptiveStatistics` and everything should
work.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Marko Kastens [mailto:Kastens at Hamburg.BAW.DE]
To: mathgroup at smc.vnet.net

Hi!

I'd like to use functions from other packages in my own package. How to do
this?

I've tried:

BeginPackage["TestPackage`",{"Statistics`ContinuousDistributions`"}]

TestFunction::usage = "TestFunction[<list>]"

Begin["`Private`"];
TestFunction[list_]:=
{
	Mean[list]
}
End[];
EndPackage[]

The problem is, that Mean is not known in the Testfunction or - if the
testfunction is declared outside private - I got the error-msg that Mean is
shadowed by other packages.
Trying to use Statistics`ContinuousDistributions`Mean[list] doesn't work
either.

Any suggestions?

Thanks,
marko



  • Prev by Date: Comparison of Mathematica on Various Computers
  • Next by Date: Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?
  • Previous by thread: Re: Namespaces/Context in Packages?
  • Next by thread: RE: Namespaces/Context in Packages?