WolframLang: Expression
WolframLang source code is made of expressions. Every part in source code, is expression. (there is no such thing as “statements”.) Everything is a expression.
- Atom
- An atom is a indivisible expression.
An atom is one of: Number, Symbol, String , Special Character. [see Atomic Expression] - Expression
-
Expression is either a single Atom , or a sequence of atoms in the form
e0[e1, e2 etc]
Each of the e is a expression.
- Head of expression
- The e0 in
e0[…]
is called the Head of expression. [see Head of Expression] - List
- A list is a expression whose head is
List
. [see List] - FullForm
-
Many commonly used functions has syntax shortcuts. For example, you can write
FullForm Shortcut Plus[3,4]
3+4
Rational[3,4]
3/4
List[3,4]
{3,4}
Equal[x,y]
x == y
SameQ[x,y]
x === y
Greater[x,y]
x > y
Set[x,3]
x = 3
- The form
e0[…]
is called FullForm. - Atomic Expression such as
3
,x
,"abc"
, are in FullForm by themselves. - The WolframEngine convert shortcut syntax to FullForm internally before eval.
- All Pattern Matching are done against FullForm.
You can use
FullForm[Hold[expr]]
to show the FullForm. [see WolframLang Syntax/Operators] - The form