From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: Update of pcase docs for the elisp manual Date: Fri, 29 Jan 2016 15:14:17 +0000 Message-ID: References: <87d1stznc6.fsf@web.de> <83io2k5yvg.fsf@gnu.org> <838u3c18w3.fsf@gnu.org> <83y4bcytk6.fsf@gnu.org> <83zivoyeh9.fsf@gnu.org> <83powkxy7s.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1454080600 1756 80.91.229.3 (29 Jan 2016 15:16:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jan 2016 15:16:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 29 16:16:32 2016 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 1aPAmL-0004VW-I0 for ged-emacs-devel@m.gmane.org; Fri, 29 Jan 2016 16:16:05 +0100 Original-Received: from localhost ([::1]:34705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPAmK-0008AY-OJ for ged-emacs-devel@m.gmane.org; Fri, 29 Jan 2016 10:16:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPAmG-0008AG-Hx for emacs-devel@gnu.org; Fri, 29 Jan 2016 10:16:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPAmD-0000ZE-BV for emacs-devel@gnu.org; Fri, 29 Jan 2016 10:16:00 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:59044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPAmD-0000Yg-4U for emacs-devel@gnu.org; Fri, 29 Jan 2016 10:15:57 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aPAlH-0003R4-IF for emacs-devel@gnu.org; Fri, 29 Jan 2016 16:14:59 +0100 Original-Received: from uk.solarflare.com ([193.34.186.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jan 2016 16:14:59 +0100 Original-Received: from andrewjmoreton by uk.solarflare.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jan 2016 16:14:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: uk.solarflare.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:MAf5Fn+Li0CddpwCKW9oZ9ykRVY= 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:198997 Archived-At: On Fri 29 Jan 2016, Eli Zaretskii wrote: >> From: Andy Moreton >> Date: Fri, 29 Jan 2016 13:39:59 +0000 >> >> This gets straight to saying what pcase is useful for (and when cond is >> sufficient for the task). > > I obviously disagree, or else I wouldn't have written that in the > first place. > > I think 'pcase' deserves a rationale, and contrasting it with another > similar facility is a good way of presenting that rationale, and at > the same time making the point that 'pcase' shouldn't be used where > 'cond' can do the job, something that came up in the recent > discussions. Fair enough. Please consider starting a new paragraph though: "The ‘cond’ form lets you choose between alternatives using predicate conditions that compare values of expressions against specific values known and written in advance. However, sometimes it is useful to select alternatives based on more general conditions that distinguish between broad classes of values. The ‘pcase’ macro allows you to choose between alternatives based on matching the value of an expression against a series of patterns. A pattern can be a literal value (for comparisons to literal values you’d use ‘cond’), or it can be a more general description of the expected structure of the expression’s value." >> Also, the description of CLAUSES for pcase and cond in the manual use: >> pcase: (PATTERN BODY-FORMS…) >> cond: (CONDITION BODY-FORMS…) >> >> However the doc strings are inconsistent with the manual: >> pcase: (PATTERN CODE...) >> cond: (CONDITION BODY...) >> >> It would be better to use consistent terms. > > Blame those who wrote the doc strings ;-) I sought improvement, not blame :-) AndyM