From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Using let-bound var inside pcase conditions Date: Mon, 17 Apr 2017 22:33:39 +0200 Message-ID: <87tw5mdba4.fsf@drachen> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1492461252 23330 195.159.176.226 (17 Apr 2017 20:34:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Apr 2017 20:34:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Help Gnu Emacs mailing list To: Kaushal Modi Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 17 22:34:08 2017 Return-path: Envelope-to: geh-help-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 1d0DLa-0005wx-NP for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Apr 2017 22:34:06 +0200 Original-Received: from localhost ([::1]:38663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0DLg-0003e3-Kc for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Apr 2017 16:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0DLD-0003dm-FL for help-gnu-emacs@gnu.org; Mon, 17 Apr 2017 16:33:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0DL9-00052c-Iz for help-gnu-emacs@gnu.org; Mon, 17 Apr 2017 16:33:43 -0400 Original-Received: from mout.web.de ([212.227.17.11]:64939) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0DL9-00052I-99 for help-gnu-emacs@gnu.org; Mon, 17 Apr 2017 16:33:39 -0400 Original-Received: from drachen.dragon ([92.208.95.114]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LoHgL-1cOhmw3AV7-00gGp3; Mon, 17 Apr 2017 22:33:35 +0200 In-Reply-To: (Kaushal Modi's message of "Mon, 17 Apr 2017 18:07:42 +0000") X-Provags-ID: V03:K0:fCyQ4xJD6YeGHLK9nQcjXF292R8VBEadJjYOda6ztMykxzo5SCJ gVY35tOXlB8yB7oUBLgn3CkLWfL4w3UZ3+IU/ln89EXjgmWc4hRbVqNIWGi4sStkN16c8HJ fJ+yQlLuVCKdRzlx2enur54JpqyGn7IRMGxSob2MDYmJs3HiZbu4IT6SXisuttFm45RVfNd PKSWzqXOCb3Q7Xl64BdiQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:+ADIY7LgUBM=:fG7V+l08atqXnbrpMMHOSP EvZsRJkB7FFxpHk9xMatcYeMMErN1oSLF4aWvdc0ZQNnq6HPjfwLXFqtHXt+87E470ZeQWOoO LISIprzLeZHub4aBBQkGLCeT5ivtdj9DQccxnww8IUj47nDSoU3ei4MEJHTZ+/9yQs7rZYWXX T2SA7Ye2NWwZ6uKymMS8qtwzQ5nqoOiR5Kw6T6nBUd3pfnT70INx5FYuNzONaZWhC9qE+Y34+ Nh/9Gum72NjiTHezbsUVLs0vy4K7lkpwDMKPhCGAXvTjL2tKSD+vcD31bSpUXdgbwIgWwEhcR P9tb3tRLwYnYmMgEEc/h8KceifXAEC9XvLj1iv4f0dcWcUNp5GJ9uagU2o5lx1S0+96zmfWXo AUU9Rt4EhGr646xwtLErsLPi11Wm+Mv767BHQxsRT8XpKTn0WlRKpUh27QMKUUF5qy+nYA5+E vMcoWGAvFAG1R4zHVl7YyxPhLH7TKHOaxOLPv3prXN+xATgDqQgXYdJno2E9ITUSQW1jmvw9x Am+Qt28AekG0wGVhKud6RiGToybP9zBu2IwH+UhyXi4Hpki01JWtnx0+GJuwr6H66Z6nup2E2 6um+Xi5aBOCBAfOJcOCMULn//8U7Csv7wBq48EVQ4fOgglM5cyd0T6Ge6Gk1EzMPoG4g7s5ZI GVlp02DNUn3Qgg0aSsJ17Ukd83spCadi4dcBSlU9Tp0n+G6WB2ZcXaBew3gZKDG1ChnUk9ost OibH1nNPC4Rp5pUVdzPmjrQb8FPqLugB84pqCitr77/IxFhDH3AG/ce8TU1ItmyUVnrjj/46 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.11 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112795 Archived-At: Kaushal Modi writes: > (message "(bad) Value is %s." (pcase var > (`nil "nil") > (`,one "one") > (`,two "two") > (_ "none of the expected"))))) I also try this from time to time just to remember that it's wrong: the first appearance of a symbol in a pcase pattern is never transformed into an `eq'uality test. Sometimes that's surprising (especially in backquote patterns), but that's how it's defined. BTW, `nil is equivalent to 'nil, and `,symbol is equivalent to just symbol as a pattern. To your question: I guess the shortest correct pattern is (pred (eq one)) Regards, Michael.