Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Identical elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88413] Re: Identical elements
  • From: "jwmerrill at gmail.com" <jwmerrill at gmail.com>
  • Date: Mon, 5 May 2008 06:10:18 -0400 (EDT)
  • References: <fvhe2h$3th$1@smc.vnet.net>

On May 3, 6:16 am, KFUPM <hussain.alqaht... at gmail.com> wrote:
> Dear All
>
> I have a list  and i need to test whether all the elements in the list
> are identical or no. What is the efficient way to do that? The output
> should be true if all elements are the same and False otherwise. One
> line command is preferred if possible.
>
> Your help is highly appreciated.
>
> Regards,
>
> HMQ

I'd like to retract that suggestion of PatternSequence.  It doesn't
work.

MatchQ[{q, 1, q, q}, PatternSequence[_]]

True

JM


  • Prev by Date: Re: Identical elements
  • Next by Date: Re: Identical elements
  • Previous by thread: Re: Identical elements
  • Next by thread: Re: Identical elements