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