Package Development

Mathematica is to its core a fundamentally extensible system, in which efficient, modular, reusable packages of any size can readily be created. Mathematica's symbolic program and interface architecture allows it to provide a uniquely flexible modern software development environment with many important original features.

ReferenceReference

Modularity Constructs »

Module localize names of variables

Block localize values of variables

DynamicModule localize interface constructs

Namespace Management »

BeginPackage, EndPackage set up namespaces for a package

Begin ▪ End ▪ $ContextPath ▪ $Packages ▪ Names ▪ CellContext ▪ ...

Package Loading & Saving

Needs load a package if needed

Save save definitions for symbols & functions

DeclarePackage ▪ DumpSave ▪ Encode ▪ ...

Options Management »

Options ▪ SetOptions ▪ OptionsPattern ▪ OptionValue ▪ ...

Messages »

Message ▪ MessageName () ▪ Check ▪ Assert ▪ Quiet ▪ ...

Syntax Coloring

SyntaxInformation specify automatic syntax annotation

Package Editing

File ► New ► Package (.m) create a package file to edit as a notebook

Packages from Notebooks

Initialization Cell define a cell to be used as initialization

Notebook History show editing history of a notebook

Object-Oriented Definition

UpSet (^=) — associate a definition with an inner construct

TagSet (/: ... =) — associate a definition with any construct

Bulletproofing »

Protect ▪ AbortProtect ▪ $VersionNumber ▪ $SystemID ▪ BlockRandom ▪ ...

Mathematica Scripts »

MathematicaScript run standalone executable scripts

$ScriptCommandLine script command-line arguments

New to Mathematica? Find your learning path »
Have a question? Ask support »