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 09:36:54 +0100 Message-ID: References: <83r2g7jrot.fsf@gnu.org> <83k1lzjq0r.fsf@gnu.org> <83in1jjmy4.fsf@gnu.org> <20181031120821.GA20575@ACM> <831s86jey9.fsf@gnu.org> <20181031160729.GB20575@ACM> <83muquhyuo.fsf@gnu.org> 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 1541061308 9210 195.159.176.226 (1 Nov 2018 08:35:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 08:35:08 +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 09:35:04 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 1gI8RU-0002GM-0g for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 09:35:04 +0100 Original-Received: from localhost ([::1]:36144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gI8TZ-0007ui-Ni for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 04:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gI8TT-0007ua-E6 for emacs-devel@gnu.org; Thu, 01 Nov 2018 04:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gI8TP-0006cr-9W for emacs-devel@gnu.org; Thu, 01 Nov 2018 04:37:07 -0400 Original-Received: from [195.159.176.226] (port=44347 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gI8TP-0006cX-0g for emacs-devel@gnu.org; Thu, 01 Nov 2018 04:37:03 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gI8RF-0001z5-OJ for emacs-devel@gnu.org; Thu, 01 Nov 2018 09:34:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@blaine.gmane.org In-Reply-To: <83muquhyuo.fsf@gnu.org> 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:230940 Archived-At: Am 31.10.2018 um 17:20 schrieb Eli Zaretskii: > I think we can do better in this part: > > Evaluate BODY with bindings made by matching PATTERN to each > element of LIST in turn. PATTERN is a pcase pattern > > I think using "matching" here is detrimental to understanding what's > going on, which is a destructuring binding that uses pcase patterns. > (The "matching" here is between the structures of PATTERN and elements > of LIST, but the usual meaning of "matching" in Emacs is different, > especially when "patterns" are mentioned nearby. So we should not use > "matching" here, at least not without significant qualifiers, like > "structure matching" or somesuch.) > > And this: > > Should the matching fail for any LIST element, the results are > undefined. > > should be reworded to explain that elements of LIST should have a > structure compatible with PATTERN, so that the destructuring works. How about this: PATTERN describes the expected structure of LIST and is used to establish bindings to corresponding elements of LIST during evaluation of BODY. Undefined behaviour results if the structure of LIST is different from that described by PATTERN. -- Achim. (on the road :-)