From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Tue, 30 Oct 2018 14:17:10 -0400 Message-ID: References: <86mur137n8.fsf@gmail.com> <20181029130132.GB4195@ACM> <20181029134722.GC4195@ACM> <20181030180941.GA5705@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540923326 19974 195.159.176.226 (30 Oct 2018 18:15:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 18:15:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 30 19:15:21 2018 Return-path: Envelope-to: ged-emacs-devel@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 1gHYXx-00055q-OU for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 19:15:21 +0100 Original-Received: from localhost ([::1]:54899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHYa4-00071W-54 for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 14:17:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHYZw-000718-76 for emacs-devel@gnu.org; Tue, 30 Oct 2018 14:17:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHYZr-0007i1-LP for emacs-devel@gnu.org; Tue, 30 Oct 2018 14:17:24 -0400 Original-Received: from [195.159.176.226] (port=48061 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHYZr-0007hL-BY for emacs-devel@gnu.org; Tue, 30 Oct 2018 14:17:19 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gHYXi-0004o6-8G for emacs-devel@gnu.org; Tue, 30 Oct 2018 19:15:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:9mi3h6VEXXVPGgRV9+gZ2mwH4e8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:230842 Archived-At: > Not everybody is familiar with dolist by any means. Is dolist's doc > string of sufficiently high quality to act as this basis? If dolist's docstring is not good enough, then I don't think it's pcase-dolist's job to fix it. >> We do have to keep the reference to `pcase` because we don't want to >> repeat the definition of what a pcase pattern can look like. > > Yes, I think that's right. > > Things I believe MUST appear explicitly in the doc string for > pcase-dolist: > 1. It is a loop over the elements of LIST, which must be a list. > 2. It attempts to match the current list element with the supplied > PATTERN, which must be a valid pcase style pattern. > 3. The BODY forms are evaluated for each element of the list. > 4. The purpose of the matching is to create bindings for symbols, and > these bindings are in force when the BODY forms are evaluated. > 5. When a pattern match fails, ..... (This needs to be stated). This is highly redundant w.r.t pcase-let and dolist. Fine for the manual, but not for docstrings. You can click on the link to the docstring of `dolist` and `pcase` (tho, I now see the link should go to `pcase-let` instead). Stefan