Minor update to SRFI 113 spec and implementation
John Cowan 18 Aug 2014 17:50 UTC
I've pushed new versions of SRFI 113 and sets.tar.gz
to <http://www.ccil.org/~cowan/temp/srfi-113.html> and
<http://www.ccil.org/~cowan/temp/sets.tar.gz>.
1) Eliminate zero-argument versions of the comparisons. Previously,
(set=?) would return #t; now it is an error.
2) Add a note that it's an error to add or delete an element from a set
or bag while iterating over it.
Implementation changes:
1) Remove support for zero-argument comparisons, per above. I was
writing a comment justifying it, and decided it was silly to allow it.
2) Add unique code for set-xor! and bag-xor!, which previously just
invoked set-xor and bag-xor. This was valid by the contract for
linear-update procedures, but Sam Tobin-Hochstadt pointed out how I
could implement a proper bag-xor!. (Moral: don't assume you should
always process the first argument first.)
3) Added lots of comments to sets-impl.scm explaining the various
algorithms used.
All tests still pass.
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
Economists were put on this planet to make astrologers look good.
--Leo McGarry