From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Thu, 1 Nov 2018 02:07:32 +0200 Message-ID: <8f4faf4e-0d00-888f-035e-057fad29a146@yandex.ru> References: <83tvlcsnee.fsf@gnu.org> <20181029134722.GC4195@ACM> <87lg6gifnb.fsf@web.de> <87muqwxs7m.fsf@ericabrahamsen.net> <83h8h3jlyd.fsf@gnu.org> <8b897e43-679b-d38c-e185-0efe19c09342@yandex.ru> <83y3aei08p.fsf@gnu.org> <83o9bahz6i.fsf@gnu.org> <83in1ihtox.fsf@gnu.org> <83h8h2hsoe.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 1541030791 30452 195.159.176.226 (1 Nov 2018 00:06:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 00:06:31 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 01 01:06:27 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 1gI0VH-0007qZ-2S for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 01:06:27 +0100 Original-Received: from localhost ([::1]:34101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gI0XN-0005EQ-8e for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2018 20:08:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gI0WY-0005EA-1O for emacs-devel@gnu.org; Wed, 31 Oct 2018 20:07:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gI0WS-0003Os-VZ for emacs-devel@gnu.org; Wed, 31 Oct 2018 20:07:45 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:36766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gI0WS-0003NT-OV for emacs-devel@gnu.org; Wed, 31 Oct 2018 20:07:40 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id a8-v6so16008626wmf.1 for ; Wed, 31 Oct 2018 17:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=E0VrzOiHloGyMX85eNM1U/EiOt6clDHLVQoyqm/OGpo=; b=WHIE8Dr+QNk4OxRsIZsigOMd0t20AOjD/H2xVBry5cJ1rp4UL0WRA9hzJNrE9vKqgP d386a4zFGhyL/vsj173uFfbQgDOihOsmcZeW/pnNRMZf5YhUye3BzU38W4UMjrTLdb1P pSCZB2763u7sdcDsmtxXkuNEz9dgAN4bfb63sW/x2FOrEavGkT7rx3zxqi3GlKD6Mk7R LzqW5zHrV8gm1ywS38ka9aE3+MWSH9034xKqksiuJMpdWodkrEERspRXmQ9w4LGgBrmO dcRld5oa/JhYZlY+addwVDgjIbYb3Vyh5jl6Y9MlF0BPAv47fIWzQakeXMIZKFQNHWjN 4Mng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=E0VrzOiHloGyMX85eNM1U/EiOt6clDHLVQoyqm/OGpo=; b=FrRLcc4xBMPN8az6O1CnNf/X5H4FAumX5/xFi8gPnFEip+/C7TMJ3dNaCyr7xK2BDq x0IpcGTiCOSbf90Bn89qivplS/iejFXokxpiCpldXMsMSIx1on7EikzSG+fL2zMX+JBh JP/J51A/Fq33TvjTvB3aB4pWZAdMZaXYeHr9WxIb9qJAEaFFPjWG4nI8K29DrGQ/LF60 dK1ulvWmKRXotYM7IXbM9k/ZB0KxzByXlK7YMyERaIwY2jJZebiHZqD/oBVUMbhvzuMS bFKpbatzdcNacjscqydyaxfhk1Hfr815iB3Upd5rQq20nBJwQaiOFWUYWNMC7w8SM5Rp 4Z3Q== X-Gm-Message-State: AGRZ1gIe87kbkVaZfQy4uYoxpRNfdQAsco2/lNZFplZZEob3iaGzHQ5l 9+f2cXa5w93NFku5DymNRJrbt7Cb X-Google-Smtp-Source: AJdET5chDSGgDZ1+EzGE8mFFcE6FsUsQp4IxlI64viPId+07QwZefLPNttAeSrgg8LjQjYD8NL9q3A== X-Received: by 2002:a1c:568b:: with SMTP id k133-v6mr4174030wmb.4.1541030856213; Wed, 31 Oct 2018 17:07:36 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id k5-v6sm7292693wre.82.2018.10.31.17.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 17:07:35 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b 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:230928 Archived-At: On 31.10.2018 22:03, Stefan Monnier wrote: >> A thing can be called "destructuring" if it destructures something. >> It's like a "flying carpet": the carpet that flies. But in our case >> the patterns don't destructure anything, they are a means for >> destructuring. > > And let's not forget that what I used this term currently is to talk > about the specific way pcase patterns are used within pcase-let > (i.e. the way pcase-let and friends skip the tests to verify that the > pattern does match). That part of the explanation is pretty counter-intuitive to me. I mean, I get what it's saying (pcase-let skips certain checks), but that's not a property of a pattern (which is a certain form), so the phrase "destructuring pattern" (which, in my mind, should just describe the pattern) shouldn't imply a particular aspect of its use. The way I think of the situation is pcase performs both the structure check and destructuring, and pcase-let only performs destructuring. But destructuring is present in both cases and it's a property of the pattern (and maybe of the input data if the pattern includes an "(or"). > So maybe we should just say "a pattern used to destructure" to clarify > that it's not a property of the pattern but of the way it's being used. Maybe we shouldn't try to explain that through saying that patterns exhibit a certain property in this situation, and explain that purely in terms of behavior of certain macros (pcase-let and pcase-dolist, IIRC)?