Re: LAST CALL for SRFI-113, Sets and bags John Cowan 19 Aug 2014 18:18 UTC

Kevin Wortman scripsit:

> One last thing: in alist->bag and alist->bag!, what happens if the same
> element appears multiple times, with different counts, in the alist? Or is
> that implicitly disallowed by the definition of what an alist is?

The usual uses of alists mean that the first appearance of a key should
win, which is how assoc works, so that you can push new mappings on top
of old ones non-destructively.

Unfortunately, the implementation is buggy and makes the last appearance
win.  That's easy to fix for alist->bag, but tricky for alist->bag!,
where we want the first appearance *in the alist* to win, beating both
later appearances and any existing entry.  Suggestions?

--
John Cowan          http://www.ccil.org/~cowan        xxxxxx@ccil.org
MEET US AT POINT ORANGE AT MIDNIGHT BRING YOUR DUCK OR PREPARE TO FACE WUGGUMS