Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Defining Variables and Functions > Attributes >

Unprotect

Unprotect[s1, s2, ...]
removes the attribute Protected for the symbols si.
Unprotect["form1", "form2", ...]
unprotects all symbols whose names textually match any of the formi.
  • A typical sequence in adding your own rules for built-in functions is Unprotect[f];definition;Protect[f].
Default behavior:
Unprotect and modify the definition:
New behavior:
Default behavior:
In[1]:=
Click for copyable input
Out[1]=
Unprotect and modify the definition:
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
New behavior:
In[5]:=
Click for copyable input
Out[5]=
Unprotect several symbols:
Unprotect all symbols in the current context:
Unprotect a system symbol to make a definition for it:
Restore protection:
Unprotect and clear all symbols in a package, to allow it to be read twice:
Unprotecting a symbol is equivalent to clearing the Protected attribute:
Unprotect returns the list of symbols actually unprotected:
To modify definitions of a protected symbol, unprotect it first:
To unprotect all symbols given in a variable, use Evaluate:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team