next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > packages > needsPackage

needsPackage -- load a package if not already loaded

Synopsis

Description

The file PACKAGENAME.m2 should be on the load path and should contain a package named PACKAGENAME.

For example, to load the sample package FirstPackage:

i1 : needsPackage "FirstPackage"

o1 = FirstPackage

o1 : Package
i2 : needsPackage "FirstPackage"

o2 = FirstPackage

o2 : Package
The second time the package was not reloaded.

See also

Ways to use needsPackage :