MathGroup Archive 2001

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

Search the Archive

Re: List-Operations on Heads other than List

"Orestis Vantzos" <atelesforos at> wrote in message
news:9i3pf2$lsh$1 at
> do keep in mind though, that Select searches in all the levels of your
> expression and you might get weird results because of this.


Select only selects from level one, ignoring heads.
You may be thinking of  Cases:

Select[h[a,b[c],d, e], MatchQ[#,_Symbol]&, 2]


Cases[h[a,b[c],d, e], _Symbol,{1, 2}, 4,Heads\[Rule]True]


Note that Select uses the head h as a wrapper while Cases uses List.

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

  • Prev by Date: Re: freebsd and mathematica
  • Next by Date: Partitioning 1-D list into 2-D Matrix
  • Previous by thread: Re: List-Operations on Heads other than List
  • Next by thread: Should Pure Functions Require &