Update

Update[symbol]
tells the Wolfram Language that hidden changes have been made which could affect values associated with a symbol.

Update[]
specifies that the value of any symbol could be affected.

DetailsDetails

  • Update manipulates internal optimization features of the Wolfram Language. It should not need to be called except under special circumstances that rarely occur in practice.
  • One special circumstance is that changes in the value of one symbol can affect the value of another symbol by changing the outcome of Condition tests. In such cases, you may need to use Update on the symbol you think may be affected.
  • Using Update will never give you incorrect results, although it will slow down the operation of the system.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Make sure that values that depend on f are returned correctly:

In[1]:=
Click for copyable input

The value of t depends on the definitions for f:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=

Now change the value of g that f, in turn, depends on:

In[4]:=
Click for copyable input

The value of t is still based on the old value of f that was correct before g was changed:

In[5]:=
Click for copyable input
Out[5]=

But the value of f[] has changed:

In[6]:=
Click for copyable input
Out[6]=

Tell the Wolfram Language that changes have been made affecting values that depend on f:

In[7]:=
Click for copyable input

Now the value of t returns as expected:

In[8]:=
Click for copyable input
Out[8]=
Introduced in 1988
(1.0)