MathGroup Archive 1995

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

Search the Archive

Re: Using Hold, ReleaseHold, and Unevaluated

  • To: mathgroup at
  • Subject: [mg2340] Re: Using Hold, ReleaseHold, and Unevaluated
  • From: wagner at (Dave Wagner)
  • Date: Wed, 25 Oct 1995 02:13:03 -0400
  • Organization: University of Colorado, Boulder

In article <DGxuxt.GIJ at>, I wrote:

>this function flattens a nested list without allowing the
>stuff inside of it to evaluate...
>...I defined my own "hold" head hh so that
>there'd be no confusion in case the expression being flattened
>contained, e.g., literal calls to Hold.
>    In[2]:=
>	SetAttributes[hh, HoldAll]
>	SetAttributes[flat, HoldFirst]
>	flat[stuff_] :=
>		Flatten[Hold[stuff] /. List->Hold, Infinity, Hold] /.
>			Hold[x__] :> Hold[{x}]
>    In[5]:=
>	flat[{{x1, x2}, {{x3}, x4}}]
>    Out[5]=
>	Hold[{x1, x2, x3, x4}]

As you can see, I never use the head "hh".  Originally I wrote the
function like this:

	Flatten[hh[stuff] /. List->hh, Infinity, hh]

but upon reflection decided to use Hold instead of hh.  Unfortunately,
I didn't change the explanation of the function to match.  Sorry
for any confusion this might have caused.

		Dave Wagner
		Principia Consulting
		(303) 786-8371
		dbwagner at

  • Prev by Date: RE: PC and MAC MMA compatibility
  • Next by Date: RE: There must be a better way!
  • Previous by thread: Re: Using Hold, ReleaseHold, and Unevaluated
  • Next by thread: ISSAC'96 First Announcement and Call for Papers