Re: Selection of sublist using Cases

• To: mathgroup at christensen.cybernetics.net
• Subject: [mg852] Re: Selection of sublist using Cases
• From: rubin at msu.edu (Paul A. Rubin)
• Date: Wed, 26 Apr 1995 00:19:22 -0400
• Organization: Michigan State University

```In article <3mvegd\$r0s at news0.cybernetics.net>,
sands at rs1.npt.nuwc.navy.mil (Charlie Rosenthal) wrote:
->Mathgroup,
->
->I wonder if someone could explain why the following doesn't
->seem to work, and hopefully, what might.
->
->I have a list such as:
->
->hullHL = {{12. , 34., 3, "POLY","aTop",{1.,2.,3.}},
->          {15. , 22., 2, "POLY","aBottom",{1.,2.,3.,4.}}
->           .      .   .    .         .          .
->           .      .   .    .         .          .
->
->          }
->
->I would like to form from this list a sublist consisting of all
->elements of the form {x_Real,y_Real,z_Integer,s1_String,"aTop",d_List}.
->
->Cases[hullHL,{x_Real,y_Real,z_Integer,s_String,"aTop",d_List}]
->
->returns {}. Why?
->
->Charlie E. Rosenthal, sands at rs1.npt.nuwc.navl.mil
->
I pasted your example directly into Mma (other than the ellipsis in the
definition of hullHL) and the Cases command worked.  So my best guess is
whatever actually creates your list is giving some element a head other
than what you think it is (Real, Integer, String, List), even though it
prints similarly to the example above.  Try FullForm[ hullHL ] and see if
anything untoward shows up.

Paul

**************************************************************************
* Paul A. Rubin                                  Phone: (517) 432-3509   *
* Department of Management                       Fax:   (517) 432-1111   *
* Eli Broad Graduate School of Management        Net:   RUBIN at MSU.EDU    *
* Michigan State University                                              *
* East Lansing, MI  48824-1122  (USA)                                    *
**************************************************************************
Mathematicians are like Frenchmen:  whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different.                                    J. W. v. GOETHE

```

• Prev by Date: Mathematica in Calculus Workshop
• Next by Date: Re: A Mathematica Puzzle Involving Computation of Expected Utilities
• Previous by thread: Selection of sublist using Cases
• Next by thread: "unChopping" oddity explained--Thanks