MathGroup Archive 1997

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

Search the Archive

Re: Q : Lists as sets.

  • To: mathgroup at
  • Subject: [mg7854] Re: [mg7810] Q : Lists as sets.
  • From: "C. Woll" <carlw at>
  • Date: Thu, 17 Jul 1997 02:01:36 -0400
  • Sender: owner-wri-mathgroup at

On Sat, 12 Jul 1997, Gadi Oron wrote:

> Hi there,
> I want to use a list as a mathematical set. How can I do that? (Nothing in
> the MMA book).
> I found one (not elegant) way to do it : Allways do set=Union[list] but
> that is really ugly.
> Any ideas?

Hi Gadi,

Here is one technique, with f being the head of the set.


You need the Unevaluated wrapper to prevent infinite recursion. Note that
this definition is much faster than the following somewhat more intuitive


Carl Woll

  • Prev by Date: Re: Print symbol value on plot
  • Next by Date: Re: Question on Positive[x]=True
  • Previous by thread: Q : Lists as sets.
  • Next by thread: Re: Q : Lists as sets.