[Top][All Lists]

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

Re: [ELPA] New package: hap.el

From: Tino Calancha
Subject: Re: [ELPA] New package: hap.el
Date: Thu, 2 Mar 2017 18:37:05 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)

On Thu, 2 Mar 2017, Nicolas Petton wrote:

Yes, indeed.  The bug is actually in `map-apply':

 (let ((map '((1 . a) (1 . foo) (2 . b))))
   (map-apply (lambda (key val) key)
              map)) ;; => (1 1 2)

I guess we don't want to iterate over duplicate keys.
Hi Nico,

i guess following might also confuse someone:

(let* ((ht #s(hash-table test equal data ("foo" 1 "bar" 2)))
       (alist (map-into ht 'list)))
   (map-elt ht "foo")
   (map-elt alist "foo")
   (cdr (assoc "foo" alist))))
(1 nil 1)

Probably would be safer default to `assoc' in `map-elt'. That is consistent with the default test in `map-contains-key' and with
the hash table test in `map--into-hash-table'.

Best regards,

reply via email to

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