Problem in loading own Package

• To: mathgroup at smc.vnet.net
• Subject: [mg27127] Problem in loading own Package
• From: Ossama Kullie <kullie at hrz.uni-kassel.de>
• Date: Sun, 4 Feb 2001 21:27:10 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```
Dear Mathematica users can you help me?

I have written the folloing  package

BeginPackage["Poisson`"]
Clear[PoissonBracket]
PoissonBracket::usage = "PoissonBracket[a, b,n] calculates the Piosson
bracket for tow functions a and b which depend on the variables p, q"
Begin["`Private`"]
PoissonBracket[a_, b_, n_] := Block[{pk, n},
pk =
Simplify[
Sum[D[a, q[i]]* D[b,p[i]] - D[a,p[i]] * D[b,q[i]], {i,1,n}]]]
End[]
EndPackage[]

and I have put it in a file Poisson.m, and  tried all possibilties to
load the package but it doesnot work!
Mathematica has read the file Poisson.m, but the function PoissonBracket
is not created
As Example :
Needs["Poisson`", "Poisson.m"]
give the folloing error
Needs::nocont: Context Poisson` was not created when Needs was
evaluated.
or: <<Poisson`
then
?? PoissonBracket
Information::notfound: Symbol PoissonBracket not found.

or: Get["Poisson.m"]
and then
?? PoissonBracket
nformation::notfound: Symbol PoissonBracket not found.

the folloing information may be usfel to anser my quation
\$ContextPath
Context[Poisson]
?? Poisson

this give the Output

{"Global`", "System`"}
"Global`"
"Global`Poisson"
the funktion PoissonBracke work very well, when I create it in my
Notebook, only in a package doesnot!
I cannot find any error, why I cannot load the
function PoissonBracket from the pachage? .

```

• Prev by Date: Re: Negation versus Exponential
• Next by Date: Re: Parametric Plot
• Previous by thread: MATHEMATICA PROGRAM
• Next by thread: Re: Problem in loading own Package