original meaning of System` functions
- To: mathgroup at smc.vnet.net
- Subject: [mg115240] original meaning of System` functions
- From: hemmecke <hemmecke at gmail.com>
- Date: Tue, 4 Jan 2011 18:51:42 -0500 (EST)
Is there any way to call the original Mathematica behaviour of a
function from the System context in case it has previously been
unprotected and redefined?
For example, how can I access the original meaning of ClearAll after
Unprotect[ClearAll,Clear]; ClearAll[__]:=True;Clear[__]:=True;
?
I just temporarily (i.e. in some safe environment) want to access the
system defined meaning, but actually don't want to undo any modified
behaviour.
Ralf
In[1]:= Unprotect[ClearAll,Clear]; ClearAll[__]:=True;Clear[__]:=True;
In[2]:= SetAttributes[ClearAll,{Protected, Locked}]
In[3]:= SetAttributes[Clear,{Protected, Locked}]
In[4]:= a[x_]:=x^3
In[5]:= ClearAll[a]
Out[5]= True
In[6]:= ClearAll[ClearAll]
Out[6]= True
In[7]:= System`ClearAll[a]
Out[7]= True
In[8]:= ??a
Global`a
a[x_] := x^3