From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN Date: Mon, 10 Jul 2017 22:02:34 +0900 (JST) Message-ID: References: <87tw2rva7v.fsf@calancha-pc> <87mv8j6y1z.fsf@petton.fr> <87y3s2m76v.fsf@calancha-pc> <8737a83fq6.fsf@calancha-pc> <87mv8c31cc.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1499691808 12166 195.159.176.226 (10 Jul 2017 13:03:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2017 13:03:28 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Nicolas Petton , Tino Calancha , 27584@debbugs.gnu.org, Stefan Monnier To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 10 15:03:19 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 1dUYLE-0002B8-NE for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Jul 2017 15:03:08 +0200 Original-Received: from localhost ([::1]:40694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUYLI-0000fo-Nr for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Jul 2017 09:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUYLD-0000fU-Ct for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 09:03:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUYL8-00067H-FV for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 09:03:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57075) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUYL8-00067C-BQ for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 09:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dUYL8-0007VL-2O for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 09:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2017 13:03:02 +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.149969176828826 (code B ref 27584); Mon, 10 Jul 2017 13:03:02 +0000 Original-Received: (at 27584) by debbugs.gnu.org; 10 Jul 2017 13:02:48 +0000 Original-Received: from localhost ([127.0.0.1]:59752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUYKu-0007Ur-9x for submit@debbugs.gnu.org; Mon, 10 Jul 2017 09:02:48 -0400 Original-Received: from mail-pf0-f194.google.com ([209.85.192.194]:33357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUYKt-0007Uf-88 for 27584@debbugs.gnu.org; Mon, 10 Jul 2017 09:02:47 -0400 Original-Received: by mail-pf0-f194.google.com with SMTP id e199so14446721pfh.0 for <27584@debbugs.gnu.org>; Mon, 10 Jul 2017 06:02:47 -0700 (PDT) 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=WV0wSaZYtOjiwyKCgxlQ//bTWJl9uk7QjaFUzAkbKCA=; b=TWphoKb4qojxU/f8wrgUW5M6Kyv5gEz0N3i0o5/nLUnR+T09A4Y4X7O6Qd7SLvIifl OyKAd6k4px82slTV8U0gRGtswZ93Z70gvPDLUiiZOBirA6roPDDPHgtq6fM91O8ayFcM KmE3n1vasd30hkAGIH2UMFcH34L4tVcW0dzRRIejsIAfvcm9V9tvqGz/6JcbLkHTf0fT t/Yvnss1rN5HMeRy3POlQfTa+m3lG1BSEHDheEhwaz8Q6IvshqesYdylyuJdJzrgCpTB 8ef5AkmOKvDOlXnwcb+FaW7Rd9OnUYKcQ20fANCuxiFZQFX/dDrBLAXCQ2N3UMfnM2ks 6bbw== 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=WV0wSaZYtOjiwyKCgxlQ//bTWJl9uk7QjaFUzAkbKCA=; b=lsYnLL6FE21s972ZJl8kq3aHlL0KgZhPk8yEvFWDA9NUQ8gKfxoqICbbKUc4bNINs4 otFDI9e7GPfhGEKGIFfOZx03C9T2BTmCHRpJ6ZBTSmOWM/Rk0ziXqxn9ZdZcDyL4S2P1 wv104eRJM332iMn322HjussvNFz6vzakJ8kuSut906VdEZ1ZYTJAq6TpsuOj8mvVon93 PjfuqYmQeP1kcYY/QSOtktVoRxpNvTucVIaIJbbf7jPZWTy1PGgdumIiqGrZE++BnFfF iKSHGQhT4f5bj79ZYYwuzpBknZM1H/7eCzxeNTzWzABUGqs0iWiVN6p55ovHkQup8vc/ l3YA== X-Gm-Message-State: AIVw110bZrAS5O6OcspfoHZ2Lm/F0LJGHhcf7qNsGWmP0JSKFG8QxxkI Y8MHp2Y8TBE8HA== X-Received: by 10.98.71.212 with SMTP id p81mr45463024pfi.106.1499691761287; Mon, 10 Jul 2017 06:02:41 -0700 (PDT) Original-Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id m196sm29457581pga.33.2017.07.10.06.02.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 06:02:40 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <87mv8c31cc.fsf@drachen> X-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:134396 Archived-At: On Mon, 10 Jul 2017, Michael Heerdegen wrote: > 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. Well, this code is now in the 'Limbo', because we are thinking to use the Nico solution (`assoc' having an optional arg PRED). That said, its fun to discuss about it. You know, this compiler macro is inspired in the one used by `cl-assoc' i.e., `cl--compiler-macro-assoc'. If you find a problem on it, then the same problem might arise in `cl-assoc' :-S