emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1] Fix errors generated when multiple IRC clients talk to a


From: Thien-Thi Nguyen
Subject: Re: [PATCH v1] Fix errors generated when multiple IRC clients talk to a single IRC proxy.
Date: Wed, 15 Oct 2014 08:58:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() David Edmondson <address@hidden>
() Wed, 8 Oct 2014 15:03:17 +0100

   +  (when erc-channel-new-member-names
   +    (maphash (lambda (nick user)
   +           (if (null (gethash nick erc-channel-new-member-names))
   +               (erc-remove-channel-user nick)))
   +         erc-channel-users)
   +    (setq erc-channel-new-member-names nil)))

I don't know if this is the case for Emacs Lisp, but i've been
burned when (and am thus now leery of) doing a destructive
operation on the hash table while hash walking, elsewhere
(here, ‘erc-remove-channel-user’ boils down to ‘remhash’).

Better to restructure as two passes: accumulation + destruction.
That way, we cleanly avoid a bug, whether manifest or latent.

(Someone will now point out how the hash table impl avoids this
problem entirely.  Well, good!  That just shifts the "bug" to
one of documenting this guarantee, which is easier to fix short
term, but perhaps harder to live w/ long term (e.g., when Emacs
is rebased on Guile).  "But ttn your words are vague, are you
trying to be obtuse?"  Yes, and both right and wrong, too!  :-D)

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]