Book contents
- Frontmatter
- Contents
- Preface
- 1 An introduction to Mathematica
- 2 The Mathematica language
- 3 Lists
- 4 Patterns and rules
- 5 Functional programming
- 6 Procedural programming
- 7 Recursion
- 8 Numerics
- 9 Strings
- 10 Graphics and visualization
- 11 Dynamic expressions
- 12 Optimizing Mathematica programs
- 13 Applications and packages
- Solutions to exercises
- Bibliography
- Index
2 - The Mathematica language
Published online by Cambridge University Press: 05 February 2013
- Frontmatter
- Contents
- Preface
- 1 An introduction to Mathematica
- 2 The Mathematica language
- 3 Lists
- 4 Patterns and rules
- 5 Functional programming
- 6 Procedural programming
- 7 Recursion
- 8 Numerics
- 9 Strings
- 10 Graphics and visualization
- 11 Dynamic expressions
- 12 Optimizing Mathematica programs
- 13 Applications and packages
- Solutions to exercises
- Bibliography
- Index
Summary
Although programming languages are commonly thought to have their early history in the 1940s and 1950s when the first digital computers came about, they in fact go back much earlier to the creation of the Jacquard loom (1801) and also player pianos (˜1870s), both of which used physical punch cards to code instructions. Regardless of whether you use punch cards or a more modern means to create and store your programs, programming languages are described by specifying their syntax and semantics. Syntax refers to the form, indicating what symbols can be put together in what order to make a meaningful construct in any given language. In other words, the syntax of a programming language is the set of rules that define what is a valid input or program. Semantics, on the other hand, refers to the meaning of expressions within a language. Although we will not give a complete, rigorous description of the syntax of the Mathematica language here, it is important to understand some of the basic structures and their syntax upon which everything is built. Fortunately, the Mathematica language can be understood quickly by learning about just a few basic objects. In this chapter we will focus on the Mathematica language with particular emphasis on expressions. We will also look at how to define and name new expressions, how to combine them using logical operators, and how to control properties of expressions through the use of attributes.
- Type
- Chapter
- Information
- Programming with Mathematica®An Introduction, pp. 29 - 56Publisher: Cambridge University PressPrint publication year: 2013