From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Thu, 16 Nov 2023 19:11:52 +0100 Message-ID: <87fs15d0uv.fsf@dataswamp.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37948"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:fnOB25eH/Ahk0PyDQIabbPgL4IQ= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 19:40:47 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3hIF-0009cA-D7 for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 19:40:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hHN-0001OM-P6; Thu, 16 Nov 2023 13:39:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3gqV-00028T-TL for emacs-devel@gnu.org; Thu, 16 Nov 2023 13:12:07 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3gqT-0005xb-TU for emacs-devel@gnu.org; Thu, 16 Nov 2023 13:12:07 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1r3gqR-0001j2-GP for emacs-devel@gnu.org; Thu, 16 Nov 2023 19:12:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 16 Nov 2023 13:39:52 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312826 Archived-At: Richard Stallman wrote: > `pcase' is a big and unnecessary complication on Emacs Lisp. > I think its presence worse overall. > > One can easily think of `pcase' as "just another feature", > like each of the thousands of other predefined functions and > macros in Emacs Lisp. But that picture is incorrect for > `pcase', because it does not count the cost of `pcase' > in complexity. There are, according to the below code [last], 13 011 hits for cl-lib in the Emacs source. For pcase, there are 2168. So there is no kicking that out either. But regardless of whatever, here is the use of pcase, 1525 pcase 189 pcase-let 137 pcase-dolist 95 pcase-let* 43 pcase-lambda 35 pcase-exhaustive 27 pcase-defmacro 26 pcase-tests 20 pcase-setq 19 pcase-macroexpander 10 pcase-vars 7 pcase-patterns 6 pcase-expand 5 pcase-transform 5 pcase-mutually 4 pcase-bindings 3 pcase-memoize 3 pcase-compile 2 pcase-used 2 pcase-slot 2 pcase-map 1 pcase-matches 1 pcase-default 1 pcase-bug Total: 2168 > Those of you who are fans of `pcase' may not recognize the > cost it imposes on the Emacs Lisp language. You paid that > cost already, perhaps a few years ago, and perhaps you enjoy > each new language construct you learn. Perhaps, for you, the > more complexity of features to be learned, the better. Yes, I think a lot of people will say pcase is interesting. But a lot of people will say it is very useful as well, and they will disagree it places any kind of burden on anything. In the case of pcase actually, with its pattern matching feature, I think a lot of people will say, if anything, it makes the code more light. #! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/emacs clp () { cd ~/src/emacs local re='pcase|pcase-[a-z0-9*]+' grep -E -h -o -w $re **/*.el | sort | uniq -c | sort -b -n -r echo 'Total:' $(grep -E -h -o -w $re **/*.el | wc -l) } cle () { cd ~/src/emacs local re='cl-[a-z0-9*]+' grep -E -h -o -w $re **/*.el | sort | uniq -c | sort -b -n -r | head -n 100 echo 'Total:' $(grep -E -h -o -w $re **/*.el | wc -l) } GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0) of 2023-11-01 [commit 8eb9b82ce58a8323af21f52625a401e19e279a9c] -- underground experts united https://dataswamp.org/~incal