This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Built-in Functions / Programming / Scoping  /
DeclarePackage

  • DeclarePackage[" context `", " ", " ", ... ] declares that Needs[" context `"] should automatically be executed if a symbol with any of the specified names is ever used.
  • You can use DeclarePackage to tell Mathematica automatically to load a particular package when any of the symbols defined in it are used.
  • DeclarePackage creates symbols with the attribute Stub in the specified context.
  • DeclarePackage prepends context ` to $ContextPath.
  • See the Mathematica book: Section 2.6.11.
  • See also: Needs, $NewSymbol.