There are two ways to assign a value to something in the Wolfram Language: immediate assignment (=), and delayed assignment (:=).

In immediate assignment, the value is computed immediately when the assignment is done, and is never recomputed. In delayed assignment, the computation of the value is delayed, and is done every time the value is requested.

Each time you ask for value, RandomColor[] is computed, and a new color is generated:

In[4]:=

Out[4]=

The color will typically be different every time:

In[5]:=

Out[5]=

It’s very common to use := if something isn’t ready yet when you’re defining a value.

You can make a delayed assignment for circles even though n doesn’t yet have a value:

In[6]:=

Give n a value:

In[7]:=

Out[7]=

Now you can ask for circles and the value you’ve given for n will be used:

In[8]:=

Out[8]=

The idea of delayed assignment is directly analogous to the Delayed construct we discussed for deploying webpages. In delayed assignment we don’t compute a value until we need it. Similarly, when we use CloudDeploy with Delayed we don’t compute the content of a webpage until someone asks for it.