MathGroup Archive 2006

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

Search the Archive

Re: Clearing a symbol known only through a definition


On May 26, 2006, at 4:17 AM, Andrew Moylan wrote:

> For any expression e, either e is a symbol, or Head[e] is, or
> Head[Head[e]] is, etc. Call this the "topmost symbol" in the  
> expression.
> Thus, the topmost symbol in f[x][y][z] is f.
>
> I want to write a function that takes an expression and calls Clear 
> [] on
> its topmost symbol. Can anyone think of a simple way to write such a
> function?

Clear[Evaluate[NestWhile[Head,f[x][y][z],Head[#]=!=Symbol&]]]

Regards,

Ssezi


  • Prev by Date: Re: Output Table Format Change
  • Next by Date: x/x
  • Previous by thread: Clearing a symbol known only through a definition
  • Next by thread: Re: Clearing a symbol known only through a definition