From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Easy to add with push but not to the end of a list Date: Tue, 29 Nov 2022 06:23:22 +0100 Message-ID: References: <878rju96i5.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a9F4zVESCg/2MoLo" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12018"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 06:24:09 2022 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 1ozt6H-0002uS-RG for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 06:24:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozt5k-0000nd-Jc; Tue, 29 Nov 2022 00:23:36 -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 1ozt5i-0000nR-3n for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 00:23:34 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozt5g-0004zH-3Q for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 00:23:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TjrYTYotEde6y6FkMnPVq7Yg6w9YYlISJZCBUCOtkhU=; b=YD0ZK2gl3GONwjk/W5yz/xm8jg Riyf3+vWiYtiCfWt5vVNz+8WTRedLwmaECqPm6x2L4jnW38f8aA7qNmJRMCrAee0GaV5cmJyfXeyS GBGSxyiENK/Jgu2GTH03RKoMSrJthNv8G+WXq78NePf6tGL4wg0sKrD21yTPzgfhYP8cCRM+xxG9L XxLlIO298Pae3szatp18F5bZsJtqfyoJADkF+uUcJ0az4uIjJZKfE/OKqoHQagEFOLplC5BmZePYg YOHx/jwKSXb1l/54ymVx3HPkndOYZqWtTyLMY/yEDqmP+ylrlowTa3GL3XcMk3iKnHPjVmUhbXFkd gysviAtA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1ozt5W-00043J-2L for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 06:23:22 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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:141232 Archived-At: --a9F4zVESCg/2MoLo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2022 at 10:01:24PM +0000, Heime wrote: > ------- Original Message ------- > On Monday, November 28th, 2022 at 8:19 PM, Emanuel Berg wrote: >=20 >=20 > > Stefan Monnier via Users list for the GNU Emacs text editor wrote: > >=20 > > > > Although it is easy to add to a list using push, it > > > > currently looks hideous to be able to add to the end of > > > > a list. > > >=20 > > > That's because adding to the end of a Lisp list is > > > a bad idea. >=20 > The bad idea comment disregards necessity... Q "But I /want/ to hit this nail into the wall with a spoon!" A "You can try. But please, do it in your living room. And oh, with your own spoon" Programming is somewhere between engineering and craft. In these realms, you usually try to think about what tools are appropriate for a job. Singly linked lists are a tool. They are simple, lightweight, and appropriate for keeping things in sequence, and for adding things at the front. Not at the end. Core library functions express idioms. They are expected to help people to find patterns on how to use tools appropriately (it's not much different from tools: a screwdriver has a handle, which spells "grip me here, please"). Adding a function to core (say `hsup') which suggests that it is as easy to push something at the end of a list would be misleading people to hold the screwdriver (or the knife!) at the wrong end and hurt themselves. Cheers --=20 t --a9F4zVESCg/2MoLo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY4WXQwAKCRAFyCz1etHa RoV6AJoCMofe5qWa10Vw2LAbIehnkQoWFQCfTEqz7elkVMnVglAZUPrumdhKbhY= =2dZy -----END PGP SIGNATURE----- --a9F4zVESCg/2MoLo--