From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: hap.el Date: Thu, 2 Mar 2017 18:37:05 +0900 (JST) Message-ID: References: <8760jtgymr.fsf@calancha-pc> <87varskq3j.fsf@petton.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1488447449 8286 195.159.176.226 (2 Mar 2017 09:37:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Mar 2017 09:37:29 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Tino Calancha , Stefan Monnier , Emacs developers To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 02 10:37:24 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjNAn-0001E7-Pi for ged-emacs-devel@m.gmane.org; Thu, 02 Mar 2017 10:37:21 +0100 Original-Received: from localhost ([::1]:51240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjNAs-0004hk-4J for ged-emacs-devel@m.gmane.org; Thu, 02 Mar 2017 04:37:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjNAh-0004ft-E6 for emacs-devel@gnu.org; Thu, 02 Mar 2017 04:37:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjNAd-0005j5-Fu for emacs-devel@gnu.org; Thu, 02 Mar 2017 04:37:15 -0500 Original-Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:33407) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjNAd-0005ig-AC for emacs-devel@gnu.org; Thu, 02 Mar 2017 04:37:11 -0500 Original-Received: by mail-pf0-x244.google.com with SMTP id e66so628674pfe.0 for ; Thu, 02 Mar 2017 01:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=WhGD2WlEiL4B9jgcYDsAW0sB5/+uJtT2GB8YQZwlSUY=; b=QAt15gz8dgp26nE+Q6twS+3yZdwyDYZ8YDIufnRhUqWjT7Ck3EXN5I2tl3/KllLhT8 PYK50NqueQ78i8z/Eg2aax81cjKYLsDELnDc9eqvWejURcWU+Ma0BSwy6Hc84lIofF4x npt6L+uCIRVusaOWfE5gTYZls+kECxHPzZIzvh7xsmzfeefMmiZhXmRxP5ikRPuvpyNz Xj1dAF8mjd7zUufx03TQmePYZUTdacvQERDbkHZJasSWXYLHeP7PzRefhvqZSVV5WXDe FyoSZaEGZl0D82XIRnfMUZ581RsXc2p2DY0MtpSrUMnRNe7QgqyOobWxx2hLYdjW9v1N hpNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=WhGD2WlEiL4B9jgcYDsAW0sB5/+uJtT2GB8YQZwlSUY=; b=GVj+ze4rus61VGvdsb7dyd1gol06wSnHDv8bJjST6+W9icz0wnNu1YnLzHlVtsoKi+ TTqXDNfbE4R6I3tt7QdpcADfBAur5arqAYseic3bKX6SQG19BRv4Trc6bz38vcZfKg46 OGRflRygBAtdNulArqeCWuCugrqlBjFymWaaP3MyfUOTF+JNOYIiNaMt6eCincXkNShH PgpAZgrQYUs5Bas5U6yp4thctqImRlyDQUX6HeY9QnWPVymqMZMRB+6SAqlMm2f4GRJz XiuarF1KeEpStcKaT9CtqXEFA0DCM6B4CdVo+wfYW25jycs66ogXFd85FXz9cLGM8rYX Fbhg== X-Gm-Message-State: AMke39lG/x9WULgfL1+MplYMoPJ9uM5+BqCZRcQb5Lxf0RIIt6Wo62iCVgN6hMljD3j8hw== X-Received: by 10.99.94.198 with SMTP id s189mr14427711pgb.211.1488447428843; Thu, 02 Mar 2017 01:37:08 -0800 (PST) Original-Received: from calancha-pc (104.81.147.124.dy.bbexcite.jp. [124.147.81.104]) by smtp.gmail.com with ESMTPSA id h25sm8933560pfk.119.2017.03.02.01.37.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 01:37:08 -0800 (PST) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <87varskq3j.fsf@petton.fr> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212699 Archived-At: 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))) (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, Tino