MathGroup Archive 2009

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

Search the Archive

Re: Help with Hold



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


  • 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