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: The poor state of documentation of pcase like things. Date: Sun, 03 Jan 2016 04:21:46 +0100 Message-ID: <87y4c7xs8l.fsf@web.de> References: <20151216202605.GA3752@acm.fritz.box> <87io3m60bq.fsf@web.de> <877fk1nnk0.fsf@web.de> <8760zlue3j.fsf@gmail.com> <87vb7kajgv.fsf@web.de> <83y4c9ag06.fsf@gnu.org> <87bn95m9eg.fsf@fencepost.gnu.org> <5686CDFB.2010105@dancol.org> <83fuygcs5g.fsf@gnu.org> <87r3i0l6oq.fsf@fencepost.gnu.org> <87si2fwm38.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1451791356 7186 80.91.229.3 (3 Jan 2016 03:22:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 03:22:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 03 04:22:20 2016 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 1aFZFK-0003Hl-ES for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 04:22:18 +0100 Original-Received: from localhost ([::1]:40371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFZFJ-0005xi-U9 for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2016 22:22:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFZF7-0005xQ-PE for emacs-devel@gnu.org; Sat, 02 Jan 2016 22:22:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFZF4-0004cC-Jd for emacs-devel@gnu.org; Sat, 02 Jan 2016 22:22:05 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:34405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFZF4-0004bz-5a for emacs-devel@gnu.org; Sat, 02 Jan 2016 22:22:02 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aFZEy-0002vC-8L for emacs-devel@gnu.org; Sun, 03 Jan 2016 04:21:56 +0100 Original-Received: from ip-90-186-1-98.web.vodafone.de ([90.186.1.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 03 Jan 2016 04:21:56 +0100 Original-Received: from michael_heerdegen by ip-90-186-1-98.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 03 Jan 2016 04:21:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-186-1-98.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:mmkzfUmdh5Xy6R7f1n4HJpnW5xk= 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:197405 Archived-At: Drew Adams writes: > Just one opinion, of course. I think I do the same most of the time. Probably some examples of pcase in the sources are not good code, and not good examples of how work with pcase. You can write good and bad pcase code, code that emphasizes what it's doing, and code that looks more like the result of a mechanical replacement. Maybe the latter is the case for a lot of places in the sources. But I think I agree to the goal to use cl-case where possible. cond is a bit different, since it is as powerful as pcase (in principle), so when you see a cond, you can't assume much about what is (not) done there. pcase is not only useful when destructuring is involved (though it is the most important feature). The often cited case of a long list of conditions that only tests for equality for a longer list of symbols is a good example, but also an extreme one, because this is a case that doesn't appear so often in practise. Oh, and I also think there are a lot of places in the sources that would get simpler when using pcase. Michael.