EndPackage

EndPackage[]

restores $Context and $ContextPath to their values before the preceding BeginPackage, and prepends the current context to the list $ContextPath.

Details

Examples

open allclose all

Basic Examples  (1)

Commands to define a simple package:

Modify the context and context path so that symbol creation and lookup use square`:

Here are the commands defining the function in the package:

Restore the context, but leave square` on the context path for symbol lookup:

The context is now the same as the original:

The context path is the same as the original, but with square` prepended:

Scope  (1)

Use BeginPackage and EndPackage to start and end a package in a file:

The package can be loaded with Get:

Once loaded, the definitions work:

Introduced in 1988
 (1.0)