This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Built-in Functions / Programming / Scoping /

Needs

FilledSmallSquare Needs["context`"] loads an appropriate file if the specified context is not already in $Packages.

FilledSmallSquare Needs["context`", "file"] loads file if the specified context is not already in $Packages.

FilledSmallSquare Needs["context`"] calls Get["context`"]. By convention, the file loaded in this way is the one which contains a package that defines context`.

FilledSmallSquare Example: Needs["Collatz`"] typically reads in a file named Collatz.m.

FilledSmallSquare See Section 2.7.10.

FilledSmallSquare See also: Get, DeclarePackage, FileNames.

FilledSmallSquare Related package: Utilities`Package`.

FilledSmallSquare New in Version 1.

Further Examples