[racket-dev] Lists aren't sets, but have set-like operations

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Wed Aug 21 18:58:56 EDT 2013

Ian, sets are now a generic datatype, like dictionaries.  Association lists
are dictionaries, and lists are now sets.  They're also streams and
sequences.  They're not just "set-like".

Carl Eastlund


On Wed, Aug 21, 2013 at 6:56 PM, J. Ian Johnson <ianj at ccs.neu.edu> wrote:

> I just wasted about 2 hours tracking down a bug that ended up being due to
> (set? '()) now evaluating to #t. I have no problems with set-union,
> intersection, etc. being defined for lists, but to treat lists as sets
> always is perverse to me. The contracts for set operations should use
> set-like? for (or/c set? list?) and keep the two constructions separate.
>
> This conflation is almost as bad as treating empty list as false.
>
> -Ian
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130821/62b75e02/attachment.html>

Posted on the dev mailing list.