From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Easy to add with push but not to the end of a list Date: Tue, 29 Nov 2022 07:56:53 +0000 Message-ID: References: <878rju96i5.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29957"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 08:58:00 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 1ozvVA-0007W0-KO for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 08:58:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozvUf-0004Bk-8I; Tue, 29 Nov 2022 02:57:29 -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 1ozvUa-0004B3-Cb for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 02:57:24 -0500 Original-Received: from mail-4318.protonmail.ch ([185.70.43.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozvUY-0004bh-Br for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 02:57:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1669708626; x=1669967826; bh=T1ycuvGoLIZosMwn7HSxJLaC7ACIgfK3QykbO/P2TtM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=PfMne/egiYqZvNYe5PvW0RXlXBlsxx0AWPTNDTVyGZdMkigj4XRxk1LlnsHy2AAg0 gqVNZ0OJAzJ+0sv0Qsxe5KUPdeKcIG4p8kSK8U1XFjKsC1O1sKy/Cva1I3Xg25T+Wc rnlGLfJVHEI+oUHU4/g+7mIyt2GL0DKKcVk3gXxMHiXF2lNPOByypddp33MnmAwfro arOefQy4UmuVCI+DIA2qGWkpFsWsTt8/rT5G/WvCGX8UYoti5ZMeik8a08hZp7EcPw Pv4991Ltv5FlnH5fOzjp7FZIvca6wc6jM2B6Z5IfnNouUjHwPs4yC5NEjQOsLtWq3E bM/AEYIQSyzfQ== In-Reply-To: Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.18; envelope-from=heimeborgia@protonmail.com; helo=mail-4318.protonmail.ch 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, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-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:141233 Archived-At: ------- Original Message ------- On Tuesday, November 29th, 2022 at 5:23 AM, wrote: > On Mon, Nov 28, 2022 at 10:01:24PM +0000, Heime wrote: >=20 > > ------- Original Message ------- > > On Monday, November 28th, 2022 at 8:19 PM, Emanuel Berg incal@dataswamp= .org wrote: > >=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... >=20 >=20 > Q "But I /want/ to hit this nail into the wall with a spoon!" >=20 > A "You can try. But please, do it in your living room. And > oh, with your own spoon" >=20 > Programming is somewhere between engineering and craft. In > these realms, you usually try to think about what tools are > appropriate for a job. Programming has got nothing to do with engineering or craft. =20 =20 > 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. Stefan mentioned using reverse to put it into another list. If needed the execution time would not be much different than actually place new elements at end of list. =20 > 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"). >=20 > 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. Nobody will get hurt. Just inefficient for long lists or for large number of calls. =20 > Cheers > -- > t