From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: gmane.emacs.help
Subject: Re: Advantage using mapc over dolist
Date: Tue, 03 Dec 2024 11:31:56 -0500
Message-ID: <jwvser47n77.fsf-monnier+emacs@gnu.org>
References: <ntHkGUUb3o3cQKVmEDlafNbv34pCUpVybXn2FNJra1lUNdN-H8hIqGpFJc-hz7ZaForiSd5KkBmAu7BX7xzWG_oFtdu2w0syxnkFIz43q-Y=@protonmail.com>
 <87zflevbwm.fsf@neko.mail-host-address-is-not-set>
 <jwvv7w0eu7m.fsf-monnier+emacs@gnu.org>
 <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 <tom@logand.com>
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: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>)
	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 <help-gnu-emacs-bounces@gnu.org>)
	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 <monnier@iro.umontreal.ca>)
 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 <monnier@iro.umontreal.ca>)
 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 <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
 <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
 <mailto:help-gnu-emacs-request@gnu.org?subject=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: <http://permalink.gmane.org/gmane.emacs.help/148540>

> 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