From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Garreau\, Alexandre" Newsgroups: gmane.emacs.devel Subject: What `case' have done you? [Was: Re: Replace trivial pcase occurrences in the Emacs sources] Date: Tue, 30 Oct 2018 01:36:20 +0100 Message-ID: <87a7mwqni3.fsf_-_@portable.galex-713.eu> References: <20151216202605.GA3752@acm.fritz.box> <871t9yk98g.fsf@fencepost.gnu.org> <568936F0.3060505@yandex.ru> <87wprqitj5.fsf@fencepost.gnu.org> <56893C8C.3060200@yandex.ru> <87oad2irtd.fsf@fencepost.gnu.org> <5689456A.1010601@yandex.ru> <87egdy8tyz.fsf@fencepost.gnu.org> <56895FDE.4060406@yandex.ru> <8760za8r4a.fsf@fencepost.gnu.org> <87h9iunkcg.fsf@web.de> <87h8hc4xw2.fsf_-_@web.de> <83tvlcsnee.fsf@gnu.org> <87pnw037ar.fsf@web.de> <83ftwvs7y9.fsf@gnu.org> <877ei7mkfh.fsf@web.de> <87a7mze7tl.fsf@web.de> <831s89mo03.fsf@gnu.org> <87pnvsifxt.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540859683 15943 195.159.176.226 (30 Oct 2018 00:34:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 00:34:43 +0000 (UTC) User-Agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian Cc: Michael Heerdegen , emacs-devel@gnu.org To: monnier@iro.umontreal.ca, Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 30 01:34:38 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 1gHHzQ-000406-46 for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 01:34:36 +0100 Original-Received: from localhost ([::1]:49848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHI1W-0004si-Du for ged-emacs-devel@m.gmane.org; Mon, 29 Oct 2018 20:36:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHI1Q-0004sd-TS for emacs-devel@gnu.org; Mon, 29 Oct 2018 20:36:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHI1M-0006Ii-Pk for emacs-devel@gnu.org; Mon, 29 Oct 2018 20:36:38 -0400 Original-Received: from portable.galex-713.eu ([2a00:5884:8305::1]:59612) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHI1F-0006FN-Ug; Mon, 29 Oct 2018 20:36:31 -0400 Original-Received: from localhost ([::1] helo=portable.galex-713.eu) by portable.galex-713.eu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHI16-0008Qi-Gg; Tue, 30 Oct 2018 01:36:21 +0100 PGP-FINGERPRINT: E109 9988 4197 D7CB B0BC 5C23 8DEB 24BA 867D 3F7F Accept-Language: fr, en, eo, it, br In-Reply-To: <87pnvsifxt.fsf@web.de> (Michael Heerdegen's message of "Mon, 29 Oct 2018 22:46:54 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:5884:8305::1 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:230789 Archived-At: On 2018-10-29 at 22:46, Michael Heerdegen wrote: > + (?y (setq skip t)) > + (?q (keyboard-quit)) > + (?N (setq skip 'no)))))) > + (:group (setq group (pop body))) > + (:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil)) > + (:syntax-table (setq syntax (pop body)) (setq declare-syntax nil)) > + ((or 'nil 'public :public) nil) > + ((or 'protected :protected) 'protected) > + ((or 'private :private) 'private) There are quite some (long) cases where only matching characters or symbols: is it really that problematic to use `case' (though, in such common functions body, I wouldn=E2=80=99t find cond+assoc natural either)? = I=E2=80=99m uncomfortable to make elisp, like ocaml, the kind of language where if you want the equivalent of a switch, etc. you=E2=80=99d need the pattern matching facility. That=E2=80=99s excessive promotion of pattern matching I find. And `case' wasn=E2=80=99t invented for no purpose: it already existe= d in common lisp and many lisps, and would perfectly fit there, why invisibilizing it so much, even for cases it works? Why is everybody banning so much that hard `case' from elisp common usage?