Wolfram Computation Meets Knowledge

The Wolfram Language:
Fast Introduction for Programmers

Show additional notes for:
All sections 
Get Started

Symbolic Expressions Video Version

Everything in the Wolfram Language is a symbolic expression.

Notes for Java programmers:

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.

Notes for Python programmers:

The Wolfram Language's symbolic expressions provide an extremely general 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 built-in symbolic capabilities, but you can construct arbitrary expressions with Wolfram symbolic syntax in Python using language.wlexpr from the Wolfram Client Library for Python.

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

Notes for Java programmers:

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.

Notes for Python programmers:

A Wolfram Language expression's head identifies the kind of data or operation being represented and may be transformed at any time during evaluation. Every Python object has a declared class that cannot be changed.


The argument to a function can be any symbolic expression:

In[1]:=
Out[1]=

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

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

Notes for Java programmers:

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.

Notes for Python programmers:

The Wolfram Language's symbolic expressions enable programmers to seamlessly use undefined variables as symbols in their computations. 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.


© 2024 Wolfram. All rights reserved.