Book contents
- Frontmatter
- 1 An introduction to Mathematica
- 2 The Mathematica language
- 3 Lists
- 4 Functional programming
- 5 Procedural programming
- 6 Rule-based programming
- 7 Recursion
- 8 Numerics
- 9 Graphics programming
- 10 Front end programming
- 11 Examples and applications
- 12 Writing packages
- Appendix A How expressions are evaluated
- Appendix B Debugging
- References
- Solutions to exercises
- Index
2 - The Mathematica language
Published online by Cambridge University Press: 21 March 2011
- Frontmatter
- 1 An introduction to Mathematica
- 2 The Mathematica language
- 3 Lists
- 4 Functional programming
- 5 Procedural programming
- 6 Rule-based programming
- 7 Recursion
- 8 Numerics
- 9 Graphics programming
- 10 Front end programming
- 11 Examples and applications
- 12 Writing packages
- Appendix A How expressions are evaluated
- Appendix B Debugging
- References
- Solutions to exercises
- Index
Summary
Expressions are the basic building blocks from which everything is built. Their structure, internal representation, and how they are evaluated are essential to understanding Mathematica. In this chapter we focus on the Mathematica language with particular emphasis on the structure and syntax of 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 your expressions through the use of attributes.
Expressions
Introduction
Although it may appear different at first, everything that you will work with in Mathematica has a similar underlying structure. This means things like a simple computation, a data object, a graphic, the cells in your Mathematica notebook, even your notebook itself, all have a similar structure – they are all expressions, and an understanding of expressions is essential to mastering Mathematica.
Internal forms of expressions
When doing a simple arithmetic operation such as 3 + 4 ⋆ 5, you are usually not concerned with exactly how a system such as Mathematica actually performs the additions or multiplications. Yet you will find it extremely useful to be able to see the internal representation of such expressions as this will allow you to manipulate them in a consistent and powerful manner.
Internally, Mathematica groups the objects that it operates on into different types: integers are distinct from real numbers; lists are distinct from numbers.
- Type
- Chapter
- Information
- An Introduction to Programming with Mathematica® , pp. 31 - 52Publisher: Cambridge University PressPrint publication year: 2005