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

Re: [Scheme-reports] Seeking review of sets and hash tables proposals



Per Bothner scripsit:

> >    If a bag's notion of element equality only
> >    takes into account a part of each element
> >    and ignores the rest of the element,
> >    keeping a count instead of the elements
> >    themselves would lose information.
> 
> I don't the think the bag API supports this.  I.e. using
> a bag will also lose information, unless the bag API is
> clearly specified to support this use case.  And I don't
> believe it does.

To clarify this, I have added the following sentence to the abstract:

	However, if two elements that are equal in the sense of the
	equivalence procedure, but not in the sense of <code>eqv?</code>,
	are both included, it is not guaranteed that they will remain
	distinct when retrieved from the bag.

In any case, if bags are just maps, so by the same token are sets,
but it adds clarity to write your code in terms of proper collections
(sets or bags) rather than maps.

-- 
You annoy me, Rattray!  You disgust me!         John Cowan
You irritate me unspeakably!  Thank Heaven,     cowan@x
I am a man of equable temper, or I should       http://www.ccil.org/~cowan
scarcely be able to contain myself before
your mocking visage.            --Stalky imitating Macrea

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports