From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: A protest against pcase, pcase-let, pcase-let* Date: Tue, 31 Mar 2015 22:25:30 +0300 Message-ID: <551AF4AA.3040300@yandex.ru> References: <20150331180029.GF2871@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1427829962 10091 80.91.229.3 (31 Mar 2015 19:26:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Mar 2015 19:26:02 +0000 (UTC) To: Alan Mackenzie , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 31 21:26:01 2015 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 1Yd1nR-00082L-Jm for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 21:25:57 +0200 Original-Received: from localhost ([::1]:40256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd1nQ-0000rE-OD for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 15:25:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd1n9-0000r8-T6 for emacs-devel@gnu.org; Tue, 31 Mar 2015 15:25:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yd1n4-0003Pm-Oz for emacs-devel@gnu.org; Tue, 31 Mar 2015 15:25:39 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:36456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd1n4-0003P4-Bp for emacs-devel@gnu.org; Tue, 31 Mar 2015 15:25:34 -0400 Original-Received: by wixo5 with SMTP id o5so25361677wix.1 for ; Tue, 31 Mar 2015 12:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=S/3LH5Ms+ynAKkjdBFrZNgxVJCBnY3B/Qbx5rG2k8L8=; b=HZ0UwObIEqjgq0DGtZn3v89gcm8T53RtjZrEwkWlLe7mq7PRf18xUdtFPkA1HIEtsx v+EwOKZ//jhhjI9VMHZEdV3QPu4fm7CxVwRmn5Use87hU8b1ZSd1gepQhFITjziXvV9s nGRwhgCPMtgbVpCYICjOsV3qNv+D3G75wV2e9uYesLp+Ez8rdqXQOBJ8uhk4RrPTVRNL 3jKlgdJ98McdhedElft9J80JKEujYnMw6PrYrHpk+nWsnUJ4pShiMh0KPnqDyBUgqdjZ brSus5KM8p+gJgbCLApSFBQMkdg45QYSqEOKg6qLtHo83nVZxDldlFlztHNOdNAX+HzO B3wQ== X-Received: by 10.180.74.230 with SMTP id x6mr8236257wiv.58.1427829933647; Tue, 31 Mar 2015 12:25:33 -0700 (PDT) Original-Received: from [192.168.1.3] ([82.102.93.54]) by mx.google.com with ESMTPSA id u16sm21634973wjr.5.2015.03.31.12.25.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 12:25:32 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: <20150331180029.GF2871@acm.fritz.box> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::236 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:184671 Archived-At: On 03/31/2015 09:00 PM, Alan Mackenzie wrote: > OK, maybe pcase itself has a page in the elisp manual, but this page is > very difficult to understand, certainly for me. I have attempted quite > a lot of times to make sense of it, and failed. I think it's pretty nice. It provides pattern matching, as well as destructuring (something that previously required the use of cl-lib), in a concise and performant way. The docs can look a bit dense at first, but after reading them carefully and experimenting a bit, I'm sure most people can get a hang of it. > There are two possibilities here: (i) the page is difficult because > pcase is itself difficult. It's not trivial. Pattern matching is, usually, a feature of more advanced programming languages. But that doesn't mean we shouldn't use it. > pcase-let and pcase-let* are totally absent from the elisp manual. > Their doc strings say nothing more than "Like `let' but where you can > use `pcase' patterns for bindings.", without giving any clue as to what > "`pcase' patterns" are, or what the syntax and semantics of their > "use" of them for bindings look like. `pcase' patterns are described in the `pcase' docstring, and in the manual entry for it. The semantics of use of them for bindings should be pretty apparent after you understand how to use `pcase' itself. > As an aside, I suspect that edebug will not be useful in (possibly > large) uses of these forms, given that they are implemented as macros > rather than special forms. It worked well when I tried it.