From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN Date: Mon, 10 Jul 2017 14:47:47 +0200 Message-ID: <87mv8c31cc.fsf@drachen> References: <87tw2rva7v.fsf@calancha-pc> <87mv8j6y1z.fsf@petton.fr> <87y3s2m76v.fsf@calancha-pc> <8737a83fq6.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499690956 17409 195.159.176.226 (10 Jul 2017 12:49:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2017 12:49:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Nicolas Petton , Stefan Monnier , 27584@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 10 14:49:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dUY7h-00049l-7L for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Jul 2017 14:49:09 +0200 Original-Received: from localhost ([::1]:40604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUY7m-00027y-Ng for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Jul 2017 08:49:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUY7d-00026e-4Z for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 08:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUY7a-0005w2-3Z for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 08:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57053) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUY7Z-0005ve-W7 for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 08:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dUY7Z-00079N-On for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 08:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2017 12:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27584-submit@debbugs.gnu.org id=B27584.149969088327413 (code B ref 27584); Mon, 10 Jul 2017 12:49:01 +0000 Original-Received: (at 27584) by debbugs.gnu.org; 10 Jul 2017 12:48:03 +0000 Original-Received: from localhost ([127.0.0.1]:59730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUY6c-000785-TT for submit@debbugs.gnu.org; Mon, 10 Jul 2017 08:48:03 -0400 Original-Received: from mout.web.de ([212.227.15.14]:52530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUY6b-00077b-0V for 27584@debbugs.gnu.org; Mon, 10 Jul 2017 08:48:01 -0400 Original-Received: from drachen.dragon ([88.73.234.235]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MQ8vL-1dY6T94Avz-005Iav; Mon, 10 Jul 2017 14:47:49 +0200 In-Reply-To: (Tino Calancha's message of "Sun, 9 Jul 2017 23:45:53 +0900 (JST)") X-Provags-ID: V03:K0:Yw6C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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134393 Archived-At: Tino Calancha writes: > I rewrote it as follows: > > (declare (compiler-macro > (lambda (form) > (pcase pred > (''eq `(assq ,key ,alist)) > ((or ''equal 'nil) `(assoc ,key ,alist)) > ((and (guard (macroexp-const-p key)) ''eql) > (if (floatp key) > `(assoc ,key ,alist) `(assq ,key ,alist))) > (t form))))) Is this a good idea in general? PRED could also be function-quoted, or a variable bound to `eq'. And KEY could be an expression that evaluates to a float. That would fail the `floatp' test. Michael.