Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: original meaning of System` functions
Replies: 11   Last Post: Jan 11, 2011 7:24 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
hemmecke

Posts: 15
Registered: 3/11/10
Re: original meaning of System` functions
Posted: Jan 6, 2011 2:06 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

True, it looks impossible, but maybe there is still a way to get
System`ClearAll in its original Mathematica meaning. I simply want to
get access to the builtin behaviour of the "function". Possible or
impossible?

Note, I am not asking for user-defined functions, but rather for
modified system-defined constructs. Deep inside the Mathematica kernel,
the original meaning must have been hardcoded. How to access that?

Ralf

On 01/05/2011 01:12 PM, Leonid Shifrin wrote:
> Hi,
>
> Since you both Protected and Locked these commands, it looks like you
> made all the steps to ensure that their definitions can not be altered
> in the same session, and thus their original definitions can not be
> inspected or used (at least AFAIK). Given the nature of these commands,
> I wonder whether this confirmation of impossibility to undo these
> changes was what you were actually after :)
>
> Regards,
> Leonid
>
>
> On Tue, Jan 4, 2011 at 3:51 PM, hemmecke <hemmecke@gmail.com
> <mailto:hemmecke@gmail.com>> wrote:
>
> 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
>
>





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.