[plt-scheme] Is there a set data-type?

From: Laurent (laurent.orseau at gmail.com)
Date: Fri Feb 5 09:41:07 EST 2010

On Fri, Feb 5, 2010 at 15:40, Laurent <laurent.orseau at gmail.com> wrote:
> On Fri, Feb 5, 2010 at 15:12, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
>>
>> On Feb 5, 2010, at 8:29 AM, Todd O'Bryan wrote:
>>
>>> What do people use for a set data-type? If there isn't one built-in,
>>> we're going to use a hash-table with #t as all the values.
>>
>> Just a tease: how would you use hashtable to represent infinite sets?
>
> From the top of my head, though that does probably not fit to the
> definition of an infinite set:
>
> (define towards-infinity-and-beyond (make-hash))
> (hash-set! towards-infinity-and-beyond 'zero '())
> (hash-set! 'me towards-infinity-and-beyond)

oops, please read on the last line:
(hash-set! towards-infinity-and-beyond) 'me towards-infinity-and-beyond)


Posted on the users mailing list.