Neil Jerram <[EMAIL PROTECTED]> writes:

> I think I've found a bug in assq-remove! and friends.  My
> understanding is that
> 
> (assq/v/oc-remove! alist key1)
> 
> should remove all entries from the alist whose *key* is
> eq?/eqv?/equal? to key1.
> 
> In fact, with the current CVS implementation, the effect is to
> remove all entries where the *whole entry* (key . value) is
> eq?/eqv?/equal?  to the first entry whose key is eq?/eqv?/equal? to
> key1.

Thanks!  I have applied this.

The behaviour after your patch is certainly `more' right than before,
but I'm not sure if it is the most right behaviour.

I think you are supposed to consistently use assoc-set! with
assoc-remove!, for example, and assoc-set! will not produce two cells
with an equal key.  Thus, there is always at most one cell for
assoc-remove! to remove.  Therefore, it would make sense to define
assoc-remove! et al to only remove the first cell with an appropriate
key, which allows them to do less work.

Reply via email to