From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Advantage using mapc over dolist Date: Tue, 03 Dec 2024 12:24:48 -0500 Message-ID: References: <87zflevbwm.fsf@neko.mail-host-address-is-not-set> <87o71su8jz.fsf@neko.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17940"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: tom@logand.com, help-gnu-emacs@gnu.org To: "Alfred M. Szmidt" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 03 18:25:36 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1tIWeV-0004WE-Q0 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 03 Dec 2024 18:25:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIWe2-0007N1-Lp; Tue, 03 Dec 2024 12:25:07 -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 1tIWdt-0007KP-Dh for help-gnu-emacs@gnu.org; Tue, 03 Dec 2024 12:24:57 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIWdq-0001Qb-Fy; Tue, 03 Dec 2024 12:24:56 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 38C514454F6; Tue, 3 Dec 2024 12:24:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1733246689; bh=ZbeHcph5s1FegO21f+QhlrFzy4TCv9yUri6faEAn0gY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hOVheRxxBB6xY/NRRENwIBoPSGrrZHDSgrpufo9b+GG/5N+aC+NPrGkkxm0XDCD7c 4PB7Qr708+AGmubhvh8QevuRuC2IYx62DSAq0aULH6MWPjdT4VOfHk8E64/IM6o4JE dcqfZZEhJvoPHTz4f9h/t9ymGjtIbCGyHmMgkkD1befGFxbeoT5pi2rLnVUBnsyLcb gsdOSApIyd+scxbu9y9u6SEYStkLxGRxHMuEuH6+79MQeAWMCsha1SARab+69hxS8L KSn96/8jS/crgTgBl9n6IksvO+Qd+ZJNM4g6BBeoE9UhdwU3cEmyFXbz0/g9+nf49g XDLYnJWG8jNrA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 452194454F3; Tue, 3 Dec 2024 12:24:49 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2FB4E12023A; Tue, 3 Dec 2024 12:24:49 -0500 (EST) In-Reply-To: (Alfred M. Szmidt's message of "Tue, 03 Dec 2024 12:00:28 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148545 Archived-At: > > on the contrary, it is better to use specific tools and avoid more > > general tools when possible in order to lower cognitive load. > Again, that's a personal preference. If you have to learn the more > general tool anyway, then having to additionally learn the more specific > tool may increase rather than lower the cognitive load. > Then why not use COND*? AFAICT, the "cognitive load" of a complex pattern language is about the same for `pcase` as for `match*` since the two pattern languages are very similar. And in the case of code that can use `case/ecase`, `cond*` doesn't seem to provide much benefit over just `cond` or `pcase`. Compare: (pcase actm ('armg (do-this)) ('go (do-that)))) vs (case actm (armg (do-this)) (go (do-that)))) vs (cond ((eq actm 'armg (do-this))) ((eq actm 'go (do-that)))) vs (cond* ((eq actm 'armg) (do-this)) ((eq actm 'go) (do-that))) or (cond* ((match* `armg actm) (do-this))) ((match* `go actm) (do-that)))) - Stefan