MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ClearAll ?? or what

  • To: mathgroup at
  • Subject: [mg102806] Re: ClearAll ?? or what
  • From: Albert Retey <awnl at>
  • Date: Thu, 27 Aug 2009 06:38:22 -0400 (EDT)
  • References: <h7371j$b28$>


> Is there a command that will remove all variables, custom functions,
> equations and so on?  
> I have tried every one that I can find including ClearAll [ " Global ' * "
> ], and so on.

and what is wrong with ClearAll["Global`*"] ? It should basically do
what you want. Have you problems with it? Note that you need a backquote
(` not ') and no spaces in the argument, maybe you want to copy and
paste from this post to get it right.

There are some pitfalls though:

1) If you define symbols in other contexts, you will miss them with just
"Global`*", but if you never use BeginPackage, Begin or $Context, that
should not be the case.

2) ClearAll only removes all definitions for a symbol, not the symbols
themselves. You could use Remove["Global`*"] to completely remove the
symbols, and not only their definitions. In most cases the outcome is
the same, but of course there are cases where not.



  • Prev by Date: Re: Cancel[] and finite symbolic sums ?
  • Next by Date: Re: Mathematica 7.0.0 running on Mac OSX Snow Leopard ?
  • Previous by thread: Re: Re: ClearAll ?? or what
  • Next by thread: Re: ClearAll ?? or what