MathGroup Archive 2006

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

Search the Archive

Re: Clearing a symbol known only through a definition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66674] Re: [mg66658] Clearing a symbol known only through a definition
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Sat, 27 May 2006 03:50:41 -0400 (EDT)
  • References: <200605260817.EAA01750@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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