From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Achim Gratz Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Thu, 1 Nov 2018 13:29:55 +0100 Message-ID: References: <83k1lzjq0r.fsf@gnu.org> <83in1jjmy4.fsf@gnu.org> <20181031120821.GA20575@ACM> <831s86jey9.fsf@gnu.org> <20181031160729.GB20575@ACM> <83muquhyuo.fsf@gnu.org> <20181101103633.GB4504@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1541075451 23779 195.159.176.226 (1 Nov 2018 12:30:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 12:30:51 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 01 13:30:47 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 1gIC7a-00066v-MQ for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 13:30:46 +0100 Original-Received: from localhost ([::1]:41867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIC9h-0002Um-7H for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 08:32:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIC8S-0002QM-Ot for emacs-devel@gnu.org; Thu, 01 Nov 2018 08:31:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIC6z-0000Fq-9N for emacs-devel@gnu.org; Thu, 01 Nov 2018 08:30:12 -0400 Original-Received: from [195.159.176.226] (port=33231 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIC6z-0000FK-23 for emacs-devel@gnu.org; Thu, 01 Nov 2018 08:30:09 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gIC4m-0002hL-9r for emacs-devel@gnu.org; Thu, 01 Nov 2018 13:27:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@blaine.gmane.org In-Reply-To: <20181101103633.GB4504@ACM> 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:230943 Archived-At: Am 01.11.2018 um 11:36 schrieb Alan Mackenzie: > I would also go for "... the expected structure of each LIST element ..." > and "... bindings of the corresponding parts of the element during ....". > And one or two other changes. That would give something like this: > > (pcase-dolist (PATTERN LIST) BODY...) > > Loop over a list, evaluating BODY for each element of LIST in turn. > > PATTERN describes the expected structure of each LIST element and is > used to establish bindings to the corresponding parts of the element > during the evaluation of BODY. Undefined behavior results if the > structure of any LIST element is different from PATTERN. > > For a description of PATTERNs, see `pcase'. See also `dolist'. > > What do you think? I'd lose the plural "s" on "PATTERN" in the last sentence, but other than that I think it strikes the right balance between brevity and explaining the obvious. -- Achim. (on the road :-)