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: pcase-dolist Date: Wed, 08 Jul 2015 14:20:40 +0200 Message-ID: <87wpyaet7r.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436358063 12909 80.91.229.3 (8 Jul 2015 12:21:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2015 12:21:03 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 08 14:20:57 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 1ZCoLQ-0002o8-B7 for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2015 14:20:56 +0200 Original-Received: from localhost ([::1]:34813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCoLP-000127-7G for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2015 08:20:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCoLJ-000111-Go for emacs-devel@gnu.org; Wed, 08 Jul 2015 08:20:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCoLF-0005F5-SA for emacs-devel@gnu.org; Wed, 08 Jul 2015 08:20:49 -0400 Original-Received: from mout.web.de ([212.227.15.3]:55184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCoLF-0005DX-0k for emacs-devel@gnu.org; Wed, 08 Jul 2015 08:20:45 -0400 Original-Received: from drachen.dragon ([109.45.52.8]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MVXnr-1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KN+WgVs08GTj3dNX9tujZFJQ87piUM4iLy2ZQMKPn05PsWDk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.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:187771 Archived-At: Hello, I was recently bitten by unexpected behavior of `pcase-dolist'. Like `pcase-let' (which is used internally by `pcase-dolist'), AFAICT it assumes that the pattern always matches, e.g. (pcase-dolist ((and x (pred < 0)) '(-1 0 1 2)) (message "%s" x)) prints all members of the sequence. Apart from the question whether this semantic is useful: with the current semantic, a name that includes "case" is irritating considering such a behavior. Maybe "pdolist" (and "plet", "plet*") would be better names? Anyway, an idea that came to my mind more than once: `when-let', `if-let' should really be `pcase-when-let' , `pcase-if-let'. They would be much more useful than the plain versions I think. Then `pcase-dolist' could be reimplemented using `pcase-when-let'. Michael.