Re: Count[{Unevaluated[a]},Unevaluated[a]]
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: Count[{Unevaluated[a]},Unevaluated[a]]
- From: John Lee <lee at math.washington.edu>
- Date: Wed, 2 Dec 92 10:32:47 -0800
> the above gives - a little bit surprisingly for me - 0.
> With a third argument: Count[{Unevaluated[a]},Unevaluated[a],{-1}]
> the result is 1 (as expected). Using On[] one sees that
> Count "evaluates" its arguments. Literal instead of Unevaluated gives
> a similar result.
> Why does Count do this?
Try Count[Unevaluated[{a}],Unevaluated[a]]. In your form, {Unevaluated[a]}
passes a unevaluated to List, which results in [a], which is then passed to
Count.
Jack Lee
Dept. of Mathematics
University of Washington
Seattle, WA