DeclarePackage

DeclarePackage["context`",{"name1","name2",}]

declares that Needs["context`"] should automatically be executed if a symbol with any of the specified names is ever used.

Details

Examples

open allclose all

Basic Examples  (1)

Declare that the Benchmarking package should be loaded when the Benchmark symbol is used:

The Benchmark symbol is created with the Stub attribute:

Use of the symbol implies reading the corresponding package automatically:

Properties & Relations  (1)

The named context is prepended to the search path:

Wolfram Research (1991), DeclarePackage, Wolfram Language function, https://reference.wolfram.com/language/ref/DeclarePackage.html.

Text

Wolfram Research (1991), DeclarePackage, Wolfram Language function, https://reference.wolfram.com/language/ref/DeclarePackage.html.

CMS

Wolfram Language. 1991. "DeclarePackage." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeclarePackage.html.

APA

Wolfram Language. (1991). DeclarePackage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeclarePackage.html

BibTeX

@misc{reference.wolfram_2024_declarepackage, author="Wolfram Research", title="{DeclarePackage}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/DeclarePackage.html}", note=[Accessed: 17-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_declarepackage, organization={Wolfram Research}, title={DeclarePackage}, year={1991}, url={https://reference.wolfram.com/language/ref/DeclarePackage.html}, note=[Accessed: 17-November-2024 ]}