MathGroup Archive 2001

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

Search the Archive

Re: Problem in loading own Package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27146] Re: Problem in loading own Package
  • From: Roland Franzius <Roland.Franzius at uos.de>
  • Date: Wed, 7 Feb 2001 02:12:51 -0500 (EST)
  • Organization: Universitaet Osnabrueck
  • References: <95l38f$e2r@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Its a bug (or a feature?) if you save a notebook in   menu/ file /
special / package format.
Check your *.m file using a text editor. Probably you will find it
saved  as a comment (* ... *).

Ossama Kullie wrote:
> 
> 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? .


-- 
Roland Franzius

  +++ exactly <<n>> lines of this message have value <<FALSE>> +++


  • Prev by Date: Re: Graphic problem
  • Next by Date: FW: AW: LogPlot/Plot-Identity
  • Previous by thread: Re: Problem in loading own Package
  • Next by thread: Re: Problem in loading own Package