[Top][All Lists]

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

Re: [Emacs-diffs] master 1691a51: * lisp/emacs-lisp/map.el: Make the fun

From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 1691a51: * lisp/emacs-lisp/map.el: Make the functions generic
Date: Thu, 13 Dec 2018 10:17:50 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Why not continue to check whether lists are null, rather than traversing
> their entire length:
>   (cl-defmethod map-empty-p ((map list))
>     (null map))

Indeed, thanks.  Could you install this change?

>> +(cl-defmethod map-contains-key ((map list) key &optional testfn)
>> +  (alist-get key map nil nil (or testfn #'equal)))
> I think this should get the same treatment as the hash table method,
> which checks whether DEFAULT was returned:

Same here (actually, this one was a thinko: for some reason I wrote the
code assuming alist-get would behave like assoc and return the cons


reply via email to

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