Re: Help with Hold
- To: mathgroup at smc.vnet.net
- Subject: [mg100936] Re: [mg100917] Help with Hold
- From: Oliver Ruebenkoenig <ruebenko at wolfram.com>
- Date: Thu, 18 Jun 2009 06:19:01 -0400 (EDT)
- References: <200906180852.EAA19966@smc.vnet.net>
Hello Erich,
On Thu, 18 Jun 2009, Erich Neuwirth wrote:
> 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?
>
>
does this help:
SetAttributes[toStr, HoldAll]
toStr[Null] := Null
toStr[s_] := ToString[SymbolName[Unevaluated[s]]]
{ ReleaseHold[ toStr /@ Hold[x, Null, y, Null, Null] ] }
Oliver
- References:
- Help with Hold
- From: Erich Neuwirth <erich.neuwirth@univie.ac.at>
- Help with Hold