From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Question on pcase Date: Thu, 22 Oct 2015 23:19:18 +0200 Message-ID: <87k2qe1u09.fsf@web.de> References: <871tcngdv2.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445548816 31321 80.91.229.3 (22 Oct 2015 21:20:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 21:20:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 22 23:20:06 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 1ZpNH6-000691-5M for ged-emacs-devel@m.gmane.org; Thu, 22 Oct 2015 23:19:52 +0200 Original-Received: from localhost ([::1]:34638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpNH5-0006gG-I7 for ged-emacs-devel@m.gmane.org; Thu, 22 Oct 2015 17:19:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpNH1-0006fZ-RX for emacs-devel@gnu.org; Thu, 22 Oct 2015 17:19:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpNGx-0006AD-US for emacs-devel@gnu.org; Thu, 22 Oct 2015 17:19:47 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:40101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpNGx-0006A8-NS for emacs-devel@gnu.org; Thu, 22 Oct 2015 17:19:43 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZpNGh-0005ke-9P for emacs-devel@gnu.org; Thu, 22 Oct 2015 23:19:27 +0200 Original-Received: from ip-90-186-2-166.web.vodafone.de ([90.186.2.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Oct 2015 23:19:27 +0200 Original-Received: from michael_heerdegen by ip-90-186-2-166.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Oct 2015 23:19:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-186-2-166.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:oj8mW0xgCGEKjz4J8vHOadn/eZg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:192429 Archived-At: Hello Oleh, > To be frank, I'm not a fan of `pcase', and really prefer a "for dummies" > coding style. But if it makes other people feel more productive, I'm > fine with it as long as I can read and debug it. > > One piece that I'm missing currently is the ability to eval a `pcase' > pattern. Did you try to `macroexpand' a pcase form? The result is readable, though a bit long. Note that `pcase' doesn't set variables, it is a binding construct. Since the "matching" part and the "binding" part aren't separate, but binding happens as a side effect while matching, your approach to understand the thing seems not good to me. IME the best way to transform pcase expressions into a readable form is to learn to read them. I can only advertise to give it a try. A good starting point is (info "(elisp) Pattern matching case statement") (can be improved...) But I totally understand if you don't want to learn it. FWIW I never understood bash syntax, and also don't want to learn it :-P Regards, Michael.