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

Documentation / Mathematica / The Mathematica Book / Principles of Mathematica /

Principles of Mathematica



2.1.1 Everything Is an Expression

2.1.2 The Meaning of Expressions

2.1.3 Special Ways to Input Expressions

2.1.4 Parts of Expressions

2.1.5 Manipulating Expressions like Lists

2.1.6 Expressions as Trees

2.1.7 Levels in Expressions

Functional Operations

2.2.1 Function Names as Expressions

2.2.2 Applying Functions Repeatedly

2.2.3 Applying Functions to Lists and Other Expressions

2.2.4 Applying Functions to Parts of Expressions

2.2.5 Pure Functions

2.2.6 Building Lists from Functions

2.2.7 Selecting Parts of Expressions with Functions

2.2.8 Expressions with Heads That Are Not Symbols

2.2.9 Advanced Topic: Working with Operators

2.2.10 Structural Operations

2.2.11 Sequences


2.3.1 Introduction

2.3.2 Finding Expressions That Match a Pattern

2.3.3 Naming Pieces of Patterns

2.3.4 Specifying Types of Expression in Patterns

2.3.5 Putting Constraints on Patterns

2.3.6 Patterns Involving Alternatives

2.3.7 Flat and Orderless Functions

2.3.8 Functions with Variable Numbers of Arguments

2.3.9 Optional and Default Arguments

2.3.10 Setting Up Functions with Optional Arguments

2.3.11 Repeated Patterns

2.3.12 Verbatim Patterns

2.3.13 Patterns for Some Common Types of Expression

2.3.14 An Example: Defining Your Own Integration Function

Manipulating Lists

2.4.1 Constructing Lists

2.4.2 Manipulating Lists by Their Indices

2.4.3 Nested Lists

2.4.4 Partitioning and Padding Lists

2.4.5 Sparse Arrays

Transformation Rules and Definitions

2.5.1 Applying Transformation Rules

2.5.2 Manipulating Sets of Transformation Rules

2.5.3 Making Definitions

2.5.4 Special Forms of Assignment

2.5.5 Making Definitions for Indexed Objects

2.5.6 Making Definitions for Functions

2.5.7 The Ordering of Definitions

2.5.8 Immediate and Delayed Definitions

2.5.9 Functions That Remember Values They Have Found

2.5.10 Associating Definitions with Different Symbols

2.5.11 Defining Numerical Values

2.5.12 Modifying Built-in Functions

2.5.13 Advanced Topic: Manipulating Value Lists

Evaluation of Expressions

2.6.1 Principles of Evaluation

2.6.2 Reducing Expressions to Their Standard Form

2.6.3 Attributes

2.6.4 The Standard Evaluation Procedure

2.6.5 Non-Standard Evaluation

2.6.6 Evaluation in Patterns, Rules and Definitions

2.6.7 Evaluation in Iteration Functions

2.6.8 Conditionals

2.6.9 Loops and Control Structures

2.6.10 Collecting Expressions During Evaluation

2.6.11 Advanced Topic: Tracing Evaluation

2.6.12 Advanced Topic: The Evaluation Stack

2.6.13 Advanced Topic: Controlling Infinite Evaluation

2.6.14 Advanced Topic: Interrupts and Aborts

2.6.15 Compiling Mathematica Expressions

2.6.16 Advanced Topic: Manipulating Compiled Code

Modularity and the Naming of Things

2.7.1 Modules and Local Variables

2.7.2 Local Constants

2.7.3 How Modules Work

2.7.4 Advanced Topic: Variables in Pure Functions and Rules

2.7.5 Dummy Variables in Mathematics

2.7.6 Blocks and Local Values

2.7.7 Blocks Compared with Modules

2.7.8 Contexts

2.7.9 Contexts and Packages

2.7.10 Setting Up Mathematica Packages

2.7.11 Automatic Loading of Packages

2.7.12 Manipulating Symbols and Contexts by Name

2.7.13 Advanced Topic: Intercepting the Creation of New Symbols

Strings and Characters

2.8.1 Properties of Strings

2.8.2 Operations on Strings

2.8.3 String Patterns

2.8.4 Characters in Strings

2.8.5 Special Characters

2.8.6 Advanced Topic: Newlines and Tabs in Strings

2.8.7 Advanced Topic: Character Codes

2.8.8 Advanced Topic: Raw Character Encodings

Textual Input and Output

2.9.1 Forms of Input and Output

2.9.2 How Input and Output Work

2.9.3 The Representation of Textual Forms

2.9.4 The Interpretation of Textual Forms

2.9.5 Short and Shallow Output

2.9.6 String-Oriented Output Formats

2.9.7 Output Formats for Numbers

2.9.8 Tables and Matrices

2.9.9 Styles and Fonts in Output

2.9.10 Representing Textual Forms by Boxes

2.9.11 Adjusting Details of Formatting

2.9.12 String Representation of Boxes

2.9.13 Converting between Strings, Boxes and Expressions

2.9.14 The Syntax of the Mathematica Language

2.9.15 Operators without Built-in Meanings

2.9.16 Defining Output Formats

2.9.17 Advanced Topic: Low-Level Input and Output Rules

2.9.18 Generating Unstructured Output

2.9.19 Generating Styled Output in Notebooks

2.9.20 Requesting Input

2.9.21 Messages

2.9.22 International Messages

2.9.23 Documentation Constructs

The Structure of Graphics and Sound

2.10.1 The Structure of Graphics

2.10.2 Two-Dimensional Graphics Elements

2.10.3 Graphics Directives and Options

2.10.4 Coordinate Systems for Two-Dimensional Graphics

2.10.5 Labeling Two-Dimensional Graphics

2.10.6 Making Plots within Plots

2.10.7 Density and Contour Plots

2.10.8 Three-Dimensional Graphics Primitives

2.10.9 Three-Dimensional Graphics Directives

2.10.10 Coordinate Systems for Three-Dimensional Graphics

2.10.11 Plotting Three-Dimensional Surfaces

2.10.12 Lighting and Surface Properties

2.10.13 Labeling Three-Dimensional Graphics

2.10.14 Advanced Topic: Low-Level Graphics Rendering

2.10.15 Formats for Text in Graphics

2.10.16 Graphics Primitives for Text

2.10.17 Advanced Topic: Color Output

2.10.18 The Representation of Sound

2.10.19 Exporting Graphics and Sounds

2.10.20 Importing Graphics and Sounds

Manipulating Notebooks

2.11.1 Cells as Mathematica Expressions

2.11.2 Notebooks as Mathematica Expressions

2.11.3 Manipulating Notebooks from the Kernel

2.11.4 Manipulating the Front End from the Kernel

2.11.5 Advanced Topic: Executing Notebook Commands Directly in the Front End

2.11.6 Button Boxes and Active Elements in Notebooks

2.11.7 Advanced Topic: The Structure of Cells

2.11.8 Styles and the Inheritance of Option Settings

2.11.9 Options for Cells

2.11.10 Text and Font Options

2.11.11 Advanced Topic: Options for Expression Input and Output

2.11.12 Options for Graphics Cells

2.11.13 Options for Notebooks

2.11.14 Advanced Topic: Global Options for the Front End

Files and Streams

2.12.1 Reading and Writing Mathematica Files

2.12.2 External Programs

2.12.3 Advanced Topic: Streams and Low-Level Input and Output

2.12.4 Naming and Finding Files

2.12.5 Files for Packages

2.12.6 Manipulating Files and Directories

2.12.7 Importing and Exporting Files

2.12.8 Reading Textual Data

2.12.9 Searching Files

2.12.10 Searching and Reading Strings

MathLink and External Program Communication

2.13.1 How MathLink Is Used

2.13.2 Installing Existing MathLink-Compatible Programs

2.13.3 Setting Up External Functions to Be Called from Mathematica

2.13.4 Handling Lists, Arrays and Other Expressions

2.13.5 Special Topic: Portability of MathLink Programs

2.13.6 Using MathLink to Communicate between Mathematica Sessions

2.13.7 Calling Subsidiary Mathematica Processes

2.13.8 Special Topic: Communication with Mathematica Front Ends

2.13.9 Two-Way Communication with External Programs

2.13.10 Special Topic: Running Programs on Remote Computers

2.13.11 Special Topic: Running External Programs under a Debugger

2.13.12 Manipulating Expressions in External Programs

2.13.13 Advanced Topic: Error and Interrupt Handling

2.13.14 Running Mathematica from Within an External Program

Global Aspects of Mathematica Sessions

2.14.1 The Main Loop

2.14.2 Dialogs

2.14.3 Date and Time Functions

2.14.4 Memory Management

2.14.5 Advanced Topic: Global System Information