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: The poor state of documentation of pcase like things. Date: Sun, 3 Jan 2016 03:21:28 +0200 Message-ID: <56887798.20208@yandex.ru> 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> <56886E32.70305@yandex.ru> 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 1451784115 1783 80.91.229.3 (3 Jan 2016 01:21:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 01:21:55 +0000 (UTC) Cc: michael_heerdegen@web.de, Eli Zaretskii , Daniel Colascione , dak@gnu.org, emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 03 02:21:50 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 1aFXMj-0001fv-K9 for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 02:21:49 +0100 Original-Received: from localhost ([::1]:40234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFXMi-00050e-MG for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2016 20:21:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFXMV-00050M-O6 for emacs-devel@gnu.org; Sat, 02 Jan 2016 20:21:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFXMR-0007UH-Nt for emacs-devel@gnu.org; Sat, 02 Jan 2016 20:21:35 -0500 Original-Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFXMR-0007UC-Hn; Sat, 02 Jan 2016 20:21:31 -0500 Original-Received: by mail-wm0-x229.google.com with SMTP id l65so129610726wmf.1; Sat, 02 Jan 2016 17:21:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=y53666stR2cHBLVMm1vPtnjPlwQJzs2X5z76DqgDaf8=; b=cOBguha7aQsn4fu4ok5rh0jvcFcqp2AJ6PMDcGrxoGCyFQMiZSVc2ofQ8s6BzDrooR 3VTAgXpc4o6YplzKdITHo1N1MGA9vQsTInJUF+qkzH4uv6ROsTMdZ8zIcrFlEIUBiqs3 57/uSegJt/JzD4QKtDCj/2+wHgXmru921FrDH0XZxugpe8eMnoZh6BVx5K1gkgDo75On kiDX8TYuua8WE5qTJvNW7MuXj1fgDrJjHHVB+OyWY/a47NRdWIuXwU4zFKt9qmnV5T2W SH9MCpO/ZQvPw0t9MdXKxmEh4sAGF2LpFaABCSsrwMRKeY5SdwWHJtNk/ZIbNEpWUqBO eYqQ== X-Received: by 10.28.126.84 with SMTP id z81mr75846672wmc.29.1451784091025; Sat, 02 Jan 2016 17:21:31 -0800 (PST) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id x125sm68244013wmg.1.2016.01.02.17.21.29 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jan 2016 17:21:29 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Thunderbird/43.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::229 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:197396 Archived-At: On 01/03/2016 03:07 AM, Lars Magne Ingebrigtsen wrote: > The only way you'll know whether `status-symbol' is really a symbol, and > all the cases are really symbols, is by reading the entire thing. The > 44th case could have been (_ foo bar zot), for instance. How is that different from cond? If I have cond like this: (cond ((eq status-symbol 'unauthorized) (url-http-handle-authentication nil)) ((eq status-symbol 'payment-required) (url-mark-buffer-as-dead buffer) (error "Somebody wants you to give them money")) ...) ...you'll also have to read until its end to find out for sure whether the variable name lies or not: (cond ((eq status-symbol 'unauthorized) (url-http-handle-authentication nil)) ((eq status-symbol 'payment-required) (url-mark-buffer-as-dead buffer) (error "Somebody wants you to give them money")) ((memq 'zomg status-symbol) (give-away all-moneys))) > In Common Lisp, you'd say cl-case is more restricted, yes, but I thought this discussion was about how pcase is worse than cond. > I kinda liked pcase at first, but the more I see of the pcase language, > the more sceptical I get. I'm beginning to wonder whether the whole > thing is a misfeature that should be replaced with several separate > operators. You mean pattern matching? A lot of language and library designers would disagree with you.