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 11:31:56 -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="32877"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Tomas Hlavaty Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 03 17:32:48 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 1tIVpO-0008Mf-KC for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 03 Dec 2024 17:32:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIVok-0007ui-6U; Tue, 03 Dec 2024 11:32:06 -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 1tIVoh-0007uJ-SX for help-gnu-emacs@gnu.org; Tue, 03 Dec 2024 11:32:04 -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 1tIVof-0000Ol-FW for help-gnu-emacs@gnu.org; Tue, 03 Dec 2024 11:32:03 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 758E54454D1; Tue, 3 Dec 2024 11:31:59 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1733243518; bh=kH89UKkv+S3X2ruinGkidS6ZJKzYKsslmQVov6vLco4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AqVYqMhwBTdpPJ1HAKa9x4QzWg8aGGaErpyEHdDI4Rf4nA2QSCqX2WKPZKt1rkjFV V/s5oiGYJ7kjdK3zxGz063rJT6pawuPFxE2g0/uT8rTGpIaLgB1ncbWjGMlKxLUurA ASZptvXN9tPqclaxGfLID/qBd+eYmxRVRC+JDlz8+oneB013wtjOrH+TOk0ShAv4Ot hzg4mWW3jgTFBlstuQeaZUu/+JnyLH3svj7II5ejQyF6rTvTICvj9nOtZ5T/aXKOQE 0sDyM41ufMK/N7RUj32A+j3utCjRrgC7rfZaKzDvpa8T0GcME2wi0tunSsWXHxXNdJ p0tr+k9/96TLw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 777CD4454CE; Tue, 3 Dec 2024 11:31:58 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 64C8E12047F; Tue, 3 Dec 2024 11:31:58 -0500 (EST) In-Reply-To: <87o71su8jz.fsf@neko.mail-host-address-is-not-set> (Tomas Hlavaty's message of "Tue, 03 Dec 2024 15:48:16 +0100") 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:148540 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. So you might in fact prefer to introduce another "simple case" construct which uses the same syntax as `pcase` but supports only a strict subset (the "simple" subset). Of course, you don't need to learn all of `pcase` in order to read&write the simple cases anyway, so we haven't bothered to introduce such a construct. > also the more general a tool is the less useful other orthogonal tools > become. see how much nicer eldoc is with cl-case and cl-ecase? AFAICT the difference is unrelated to the difference in semantics between the two tools, but is just the result of a different style of writing in the docstring. Maybe you're right that we should provide a more specific usage in the docstring so that `C-h f` and Eldoc show something like (pcase EXP (PATTERN BODY...)...) I don't have an opinion about that. Stefan