[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New release of SRFI 113



On 12/03/2013 08:25 PM, John Cowan wrote:
> Everyone: please review.  I plan to recommend that WG2 make this a
> optional part of R7RS-large.

Constructors

What happens when some of the elements passed to a set constructor are
equal according to the comparator? Only one of the duplicate objects
will make it into the set and the programmer may want to control which.
In another thread I think we settled on optionally passing in a
procedure to decide between pairs of duplicate elements. This issue
applies to list->set, list->set!, set-map, and bag->set as well.

set->list

"However, repeated calls to this procedure will return a list in the
same order until the set is mutated." Is there a motivation for this
requirement? An implementation could conceivably want to reorder sets
between mutations. For instance a hashtable might voluntarily shrink
itself to cooperate with garbage collection.

Bags

Personally I would prefer the term "multiset". Has that already been
considered?

bag-decrement! cannot make the count of elements less than zero, right?

It seems like the most natural equality predicate for enumeration sets
is symbol=?, not eq?.

The symbols passed to define-enumeration-type and make-enum-type must
all be distinct, right?

Why not include ...-intern! procedures for all types of sets?

Kevin Wortman