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

Testing and VerificationIntroduction

Principles of Mathematica

Introduction

Expressions

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

Patterns

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

Transformation Rules and Definitions

2.4.1 Applying Transformation Rules

2.4.2 Manipulating Sets of Transformation Rules

2.4.3 Making Definitions

2.4.4 Special Forms of Assignment

2.4.5 Making Definitions for Indexed Objects

2.4.6 Making Definitions for Functions

2.4.7 The Ordering of Definitions

2.4.8 Immediate and Delayed Definitions

2.4.9 Functions That Remember Values They Have Found

2.4.10 Associating Definitions with Different Symbols

2.4.11 Defining Numerical Values

2.4.12 Modifying Built-in Functions

2.4.13 Advanced Topic: Manipulating Value Lists

Evaluation of Expressions

2.5.1 Principles of Evaluation

2.5.2 Reducing Expressions to Their Standard Form

2.5.3 Attributes

2.5.4 The Standard Evaluation Procedure

2.5.5 Non-Standard Evaluation

2.5.6 Evaluation in Patterns, Rules and Definitions

2.5.7 Evaluation in Iteration Functions

2.5.8 Conditionals

2.5.9 Loops and Control Structures

2.5.10 Tracing Evaluation

2.5.11 Advanced Topic: The Evaluation Stack

2.5.12 Advanced Topic: Controlling Infinite Evaluation

2.5.13 Advanced Topic: Interrupts and Aborts

2.5.14 Compiling Mathematica Expressions

2.5.15 Advanced Topic: Manipulating Compiled Code

Modularity and the Naming of Things

2.6.1 Modules and Local Variables

2.6.2 Local Constants

2.6.3 How Modules Work

2.6.4 Advanced Topic: Variables in Pure Functions and Rules

2.6.5 Dummy Variables in Mathematics

2.6.6 Blocks and Local Values

2.6.7 Blocks Compared with Modules

2.6.8 Contexts

2.6.9 Contexts and Packages

2.6.10 Setting Up Mathematica Packages

2.6.11 Automatic Loading of Packages

2.6.12 Manipulating Symbols and Contexts by Name

2.6.13 Advanced Topic: Intercepting the Creation of New Symbols

Strings and Characters

2.7.1 Properties of Strings

2.7.2 Operations on Strings

2.7.3 String Patterns

2.7.4 Characters in Strings

2.7.5 Special Characters

2.7.6 Advanced Topic: Newlines and Tabs in Strings

2.7.7 Advanced Topic: Character Codes

2.7.8 Advanced Topic: Raw Character Encodings

Textual Input and Output

2.8.1 Forms of Input and Output

2.8.2 How Input and Output Work

2.8.3 The Representation of Textual Forms

2.8.4 The Interpretation of Textual Forms

2.8.5 Short and Shallow Output

2.8.6 String-Oriented Output Formats

2.8.7 Output Formats for Numbers

2.8.8 Tables and Matrices

2.8.9 Styles and Fonts in Output

2.8.10 Representing Textual Forms by Boxes

2.8.11 Adjusting Details of Formatting

2.8.12 String Representation of Boxes

2.8.13 Converting between Strings, Boxes and Expressions

2.8.14 The Syntax of the Mathematica Language

2.8.15 Operators without Built-in Meanings

2.8.16 Defining Output Formats

2.8.17 Advanced Topic: Low-Level Input and Output Rules

2.8.18 Generating Unstructured Output

2.8.19 Generating Styled Output in Notebooks

2.8.20 Requesting Input

2.8.21 Messages

2.8.22 International Messages

2.8.23 Documentation Constructs

The Structure of Graphics and Sound

2.9.1 The Structure of Graphics

2.9.2 Two-Dimensional Graphics Elements

2.9.3 Graphics Directives and Options

2.9.4 Coordinate Systems for Two-Dimensional Graphics

2.9.5 Labeling Two-Dimensional Graphics

2.9.6 Making Plots within Plots

2.9.7 Density and Contour Plots

2.9.8 Three-Dimensional Graphics Primitives

2.9.9 Three-Dimensional Graphics Directives

2.9.10 Coordinate Systems for Three-Dimensional Graphics

2.9.11 Plotting Three-Dimensional Surfaces

2.9.12 Lighting and Surface Properties

2.9.13 Labeling Three-Dimensional Graphics

2.9.14 Advanced Topic: Low-Level Graphics Rendering

2.9.15 Formats for Text in Graphics

2.9.16 Graphics Primitives for Text

2.9.17 Advanced Topic: Color Output

2.9.18 The Representation of Sound

2.9.19 Exporting Graphics and Sounds

2.9.20 Importing Graphics and Sounds

Manipulating Notebooks

2.10.1 Cells as Mathematica Expressions

2.10.2 Notebooks as Mathematica Expressions

2.10.3 Manipulating Notebooks from the Kernel

2.10.4 Manipulating the Front End from the Kernel

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

2.10.6 Button Boxes and Active Elements in Notebooks

2.10.7 Advanced Topic: The Structure of Cells

2.10.8 Styles and the Inheritance of Option Settings

2.10.9 Options for Cells

2.10.10 Text and Font Options

2.10.11 Advanced Topic: Options for Expression Input and Output

2.10.12 Options for Graphics Cells

2.10.13 Options for Notebooks

2.10.14 Advanced Topic: Global Options for the Front End

Files and Streams

2.11.1 Reading and Writing Mathematica Files

2.11.2 External Programs

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

2.11.4 Naming and Finding Files

2.11.5 Files for Packages

2.11.6 Manipulating Files and Directories

2.11.7 Importing and Exporting Files

2.11.8 Reading Textual Data

2.11.9 Searching Files

2.11.10 Searching and Reading Strings

MathLink and External Program Communication

2.12.1 How MathLink Is Used

2.12.2 Installing Existing MathLink-Compatible Programs

2.12.3 Setting Up External Functions to Be Called from Mathematica

2.12.4 Handling Lists, Arrays and Other Expressions

2.12.5 Special Topic: Portability of MathLink Programs

2.12.6 Using MathLink to Communicate between Mathematica Sessions

2.12.7 Calling Subsidiary Mathematica Processes

2.12.8 Special Topic: Communication with Mathematica Front Ends

2.12.9 Two-Way Communication with External Programs

2.12.10 Special Topic: Running Programs on Remote Computers

2.12.11 Special Topic: Running External Programs under a Debugger

2.12.12 Manipulating Expressions in External Programs

2.12.13 Advanced Topic: Error and Interrupt Handling

2.12.14 Running Mathematica from Within an External Program

Global Aspects of Mathematica Sessions

2.13.1 The Main Loop

2.13.2 Dialogs

2.13.3 Date and Time Functions

2.13.4 Memory Management

2.13.5 Advanced Topic: Global System Information

2.13.6 Advanced Topic: Customizing Your Mathematica Configuration

Testing and VerificationIntroduction