emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: hap.el


From: Nicolas Petton
Subject: Re: [ELPA] New package: hap.el
Date: Thu, 02 Mar 2017 10:03:28 +0100

Stefan Monnier <address@hidden> writes:

>> In hap.el, optionally, you can convert from alist to hash table,
>> so that:
>> (let ((map '((1 . a) (1 . foo) (2 . b))))
>>   (equal
>>    (alist-get 1 map)
>>    (gethash 1 (map-into map 'hash-table))))
>> => t
>
> Oh, you've just found a bug in map.el.  The intention is that it returns t.

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.

Cheers,
Nico

Attachment: signature.asc
Description: PGP signature


reply via email to

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