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

MathGroup Archive 2009

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

Search the Archive

Re: Length of a held expression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96589] Re: Length of a held expression
  • From: Nikolaus Rath <Nikolaus at rath.org>
  • Date: Mon, 16 Feb 2009 16:41:20 -0500 (EST)
  • References: <gn8jdj$7qa$1@smc.vnet.net> <gnbkf1$3gn$1@smc.vnet.net>

Raffy <raffy at mac.com> writes:
> Remember, Hold[{b,3}] is really just Hold[List[b,3]].
>
> And what you're looking for is something like: Length[Hold[b,3]].
>
> So replace head List with Hold, and head Hold with Length.
>
> Length @@ Hold @@@ Hold[{b,3}]

Hmmm. Ingenious :-). Thanks a lot. Although for my application
Length[Unevaluated[a]] is more concise, I'm sure I'll be grateful for
your construct at some later point.

Best,


   -Nikolaus

--
 =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2=AB

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C


  • Prev by Date: Re: Why does Derivative fail in this case?
  • Next by Date: Re: Why does Derivative fail in this case?
  • Previous by thread: Re: Length of a held expression
  • Next by thread: Re: Length of a held expression