From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: pcase-dolist Date: Wed, 08 Jul 2015 22:50:23 +0200 Message-ID: <87oajm5q7k.fsf@web.de> References: <87wpyaet7r.fsf@web.de> <87y4iqh7x0.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436388681 11895 80.91.229.3 (8 Jul 2015 20:51:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2015 20:51:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 08 22:51:12 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZCwJD-0005Od-TF for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2015 22:51:12 +0200 Original-Received: from localhost ([::1]:36840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCwJD-00089p-7j for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2015 16:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCwIg-000897-0A for emacs-devel@gnu.org; Wed, 08 Jul 2015 16:50:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCwIa-0003GO-Sl for emacs-devel@gnu.org; Wed, 08 Jul 2015 16:50:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCwIa-0003Fj-Mt for emacs-devel@gnu.org; Wed, 08 Jul 2015 16:50:32 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZCwIY-0004up-Td for emacs-devel@gnu.org; Wed, 08 Jul 2015 22:50:30 +0200 Original-Received: from ip-2-207-84-166.web.vodafone.de ([2.207.84.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jul 2015 22:50:30 +0200 Original-Received: from michael_heerdegen by ip-2-207-84-166.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jul 2015 22:50:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-2-207-84-166.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:T3DdwN6xLL1wMhddolp+B5Wp6x4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187782 Archived-At: Artur Malabarba writes: > Only if you make them like this. The idea of `(if-let ((a expr)) > body)' is that evaluate `expr' and, if it is non-nil, bind it to a and > run `body'. This doesn't exclude the possibility of `a' being a pcase > pattern. Just make sure that the the check for nil expr is done as a > separate thing, before the pattern matching. I don't know if I would like that semantic. It doesn't sound intuitive to me. > If you implement pcase-if-let the way you suggest above, isn't that > just the same as pcase? For one binding, yes. The body would be at a more prominent place though. Isn't if-let not just pcase as well? (if-let ((var expr)) then else) (pcase expr ((and var (guard var)) then) (_ else)) Michael.