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

Re: LAST CALL for SRFI-113, Sets and bags

This page is part of the web mail archives of SRFI 113 from before July 7th, 2015. The new archives for SRFI 113 contain all messages, not just those from before July 7th, 2015.



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        cowan@xxxxxxxx
MEET US AT POINT ORANGE AT MIDNIGHT BRING YOUR DUCK OR PREPARE TO FACE WUGGUMS