From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: The poor state of documentation of pcase like things. Date: Sat, 19 Dec 2015 19:29:22 +0000 Message-ID: <87h9jensod.fsf@russet.org.uk> References: <20151216202605.GA3752@acm.fritz.box> <87fuyytq6b.fsf@web.de> <87y4cqs9vn.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450553383 22858 80.91.229.3 (19 Dec 2015 19:29:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Dec 2015 19:29:43 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 19 20:29:34 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 1aANC7-0000bu-D2 for ged-emacs-devel@m.gmane.org; Sat, 19 Dec 2015 20:29:31 +0100 Original-Received: from localhost ([::1]:38396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aANC6-0005Av-Lx for ged-emacs-devel@m.gmane.org; Sat, 19 Dec 2015 14:29:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aANC3-0005Aq-Ns for emacs-devel@gnu.org; Sat, 19 Dec 2015 14:29:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aANC0-0006LE-Ek for emacs-devel@gnu.org; Sat, 19 Dec 2015 14:29:27 -0500 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:41109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aANC0-0006L4-8u for emacs-devel@gnu.org; Sat, 19 Dec 2015 14:29:24 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1aANBz-0008AN-FN; Sat, 19 Dec 2015 19:29:23 +0000 Original-Received: from cpc6-benw10-2-0-cust45.gate.cable.virginm.net ([92.238.179.46] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1aANBz-0002b3-DS; Sat, 19 Dec 2015 19:29:23 +0000 In-Reply-To: <87y4cqs9vn.fsf@web.de> (Michael Heerdegen's message of "Sat, 19 Dec 2015 17:04:12 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 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:196521 Archived-At: Michael Heerdegen writes: > Michael Heerdegen writes: > >> As far as I understand how Stefan used to work, most of the semantics of >> most of the pcase derivatives, like `pcase-let', are not yet 100% fixed, >> we are not yet sure how useful we are, or if they may later be better be >> replaced by other forms that are more general, etc. > > BTW3, we were not yet all agreed how the semantics of `pcase-dolist' > should be when the pattern doesn't match (currently, AFAIK, it loops > nonetheless). Similarly for pcase-let and pcase-lambda. For some of > these forms, we do not yet know how useful they are. pcase-lambda seems useful to me, seems to only take a single pattern, like so: (funcall (pcase-lambda (`(,x ,y)) y) '(1 2)) To me, it would be more useful if it supported multiple patterns. (funcall (pcase-lambda ((1) (message "Is a one")) (`(,_) (message "is a list"))) 1) The non-matching situation would then be in the hands of the user. Or it would be possible to make a "pcase-lambda-exhaustive" macro (probably with a better name". I'd also rename "pcase.el" to "p.el" but hey, that's a different story. > Just some examples of open questions that shows that some stuff is still > a bit of work in progress. One that's already getting quite a bit of use. Phil