Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

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:
  • Prev by Date: Re: erroneous result when adding reals
  • Next by Date: Re: Help with Hold
  • Previous by thread: Help with Hold
  • Next by thread: Re: Help with Hold