MathGroup Archive 2009

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

Search the Archive

Re: Help with Hold

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100943] Re: [mg100917] Help with Hold
  • From: "David Park" <djmpark at comcast.net>
  • Date: Thu, 18 Jun 2009 20:44:22 -0400 (EDT)
  • References: <5353647.1245315578983.JavaMail.root@n11>

I don't know how to do this is one doesn't know what the symbols are, i.e.,
I don't know how to extract the unevaluated symbol names from the
expression. But if you know what the symbol names are then you could use the
following:

x = 3; y = 1;
test = Hold[x, Null, y, Null];

Block[{x, y},
  List @@ (If[# =!= Null, SymbolName[#], Null] & /@ test)] // FullForm
List["x", Null, "y", Null]


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: Erich Neuwirth [mailto:erich.neuwirth at univie.ac.at] 


How can I transform
Hold[x,Null,y,Null,Null]
into
{"x",Null,"y",Null,Null}
even if x and/or y have assigned values?




  • Prev by Date: Re: Manipulate function
  • Next by Date: Re: Help with Hold
  • Previous by thread: Re: Re: Help with Hold
  • Next by thread: Re: Help with Hold