WOLFRAM LANGUAGE TUTORIAL
Everything Is an Expression
The Wolfram Language handles many different kinds of things: mathematical formulas, lists, and graphics, to name a few. Although they often look very different, the Wolfram Language represents all of these things in one uniform way. They are all expressions.
A prototypical example of a Wolfram Language expression is . You might use to represent a mathematical function . The function is named , and it has two arguments, and .
You do not always have to write expressions in the form . For example, is also an expression. When you type in , the Wolfram Language converts it to the standard form Plus[x,y]. Then, when it prints it out again, it gives it as .
The same is true of other "operators", such as (Power) and (Divide).
In fact, everything you type into the Wolfram Language is treated as an expression.
Some examples of Wolfram Language expressions.
You can see the full form of any expression by using FullForm[expr].
This is the full form of the expression.
Here is another expression.
Its full form has several nested pieces.
The object f in an expression is known as the head of the expression. You can extract it using Head[expr]. Particularly when you write programs in the Wolfram Language, you will often want to test the head of an expression to find out what kind of thing the expression is.
gives the "function name"
gives the name of the "operator".
You can distinguish different kinds of numbers by their heads.
|Head[expr]||give the head of an expression: the f in |
|FullForm[expr]||display an expression in the full form used by the Wolfram Language|
Functions for manipulating expressions.