Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: simple set operations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57681] Re: [mg57635] simple set operations
  • From: "Barthelet, Luc" <lucb at ea.com>
  • Date: Sat, 4 Jun 2005 03:04:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I posted an answer at
http://www.mathematica-users.org:8080/webMathematica/wiki/wiki.jsp?pageN
ame=FAQ_Lists
Where you can also download the code.
Luc
-----Original Message-----
From: Edward Peschko [mailto:esp5 at pge.com]
To: mathgroup at smc.vnet.net
Subject: [mg57681] [mg57635] simple set operations

hey all,

I'm hesitant to ask these questions (because they are so simple) but
after a
15 minute search through the docs I'm getting nowhere, so here goes:

    1) what's the easiest way to generate a list of elements? ie:

     'a' .. 'h' == { a,b,c,d,e,f,g,h }

    2) Is there a quick way to check whether an element is in a set?

     if ('a' == (any('a','b','c','d')) { print "a is in a,b,c,d"; }

The first one I see could possibly be done by 'Array', but I don't see
how -
the '#' refers to the generation of numbers, but there seems to be no
corresponding 'letter' symbol.


As for #2, the easiest way would be through an overloading of the =
'=='
operator,
but again, that doesn't seem to work..

Thanks much for any help,

Ed




  • Prev by Date: Re: mml files
  • Next by Date: Re: Print a selection within
  • Previous by thread: Re: simple set operations
  • Next by thread: Re: simple set operations