Wolfram Language Fast Introduction for Programmers
About the Wolfram Language »

Symbolic Expressions

Everything in the Wolfram Language is a symbolic expression.

numbers strings images arrays graphs formulas documents interfaces code ...

Symbolic expressions provide an extremely general way of representing data in a uniform tree-like structure. They add a high level of flexibility in programming, allowing manipulation of both structure and content. Java does not have symbolic capabilities, although basic features may be available using third-party libraries.

Symbolic expressions in the Wolfram Language are a generalized way of representing data within a uniform tree-like structure. They add a high level of flexibility in programming, allowing manipulation of both structure and content. Python does not have the same symbolic capabilities, although features can be simulated with third-party libraries or Python's dynamic structure.

All symbolic expressions have the same fundamental structure: head[arguments]

X

X

X

X

An expression's head identifies the type of data or operation being represented. Unlike in Java, which is statically typed, a Wolfram Language expression's head may transform during evaluation.

An expression's head identifies the type of data or operation being represented. A Wolfram Language expression's head may transform during evaluation. The head can be thought of as the outermost level of any expression.

The argument to a function can be any symbolic expression:

In[1]:=
X
Out[1]=

The Wolfram Language is fully symbolic, so undefined variables can always just
stand for themselves:

In[1]:=
X
Out[1]=

Uninitialized Java objects and primitives generally take on default values of null, 0 or false, and attempting to use such variables can cause NullPointerException or other errors to be thrown.

Unassigned variables in Python are considered "undefined", and attempting to use an undefined variable causes a NameError.

FullForm always shows the underlying structure.
Head always gives the head of an expression; Length gives the number of arguments.