>>>>> "Marius" == Marius Vollmer <[EMAIL PROTECTED]> writes:

    Marius> 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.

    Marius> Thanks!  I have applied this.

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

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

I agree.  Would you like a further patch for this, or will you just
change the 3 "while"s back to "if"s?  I'll handle the associated
documentation change as part of my reference manual work.

Regards,

        Neil

Reply via email to