From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: append, push, and add-to-list. Date: Mon, 5 Jul 2021 14:22:17 +0800 Message-ID: References: <8735suaw71.fsf@zoho.eu> 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="11698"; mail-complaints-to="usenet@ciao.gmane.io" To: Hongyi Zhao , Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 05 08:23:01 2021 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 1m0I0T-0002sY-Cu for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 08:23:01 +0200 Original-Received: from localhost ([::1]:49942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0I0S-00035G-Eq for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 02:23:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0I00-000358-Re for help-gnu-emacs@gnu.org; Mon, 05 Jul 2021 02:22:32 -0400 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:43675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0Hzz-0002l8-4m for help-gnu-emacs@gnu.org; Mon, 05 Jul 2021 02:22:32 -0400 Original-Received: by mail-lf1-x12d.google.com with SMTP id a18so30434910lfs.10 for ; Sun, 04 Jul 2021 23:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=fTpCZkNcbVTjbYWI3tpqg1VTyc4l7GJ0S2At5jvkYNI=; b=UoZnUu6huQ3w/KMHbKJHITq3n34aU9FMldGYVWcmezvloiOUjd8NirhPzBtVrqpdTg G3b8O8cE4P8gqZ4vHXSWs4Jdjyg0nH0EEpmBr3XOO2yOmTTcgwSzYqQPel2EISzYE854 4Vr3l/eYK/13exVF5PFaYY9SHAzghQDaKtbJScb/y91nKBXcgPCV5qTT7u3plCvruAuv Wr27thJjxcBIv7t7fsE7a+BaoQKmmFjCWVWCRg12za9FXwLjkKCBYneFRVaRhW/8KOLv c5UliDhvTQNJzoFLF9lnEx6PKSK6mzPF5nrScq5pJI/JwLxKGntiOIUwiGglkhp3PGK8 HVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=fTpCZkNcbVTjbYWI3tpqg1VTyc4l7GJ0S2At5jvkYNI=; b=URZVpE+kd7EOeNfWH7/jscskOsCCMmJpjqFEERejvVfugEbX/mYYLBY9lNBFo7/MIf lEGIef+Fw0BtjxwtvluXswcDIhlqDjf6up+jixnusrbGtxsHcfMKhulCYSGP7aSkq/Co 22rz+W71KQPSHpbkFiGgnQwn8L40LCQEhy2ZjmJi4uPbGPPJ9H1SK4vS56NFkyef0VRG 6hiuAYSmVNG/9UE09ynsloELEt0Mq9j0lcr7LncciykwWugBQROfmg/vbSQn4jXj0qwH hVAiQVusEFrJQSj1k1mcHLHBSdk83VWf9DZBRR6RQ/OcLYr5u/M80ckp3rTWUMZBiZCW bVpw== X-Gm-Message-State: AOAM530ubjm24VAzKjcZ7g1L3rcg/7SfG1GIRoy0Rk+ObK9BDdP/mPx1 GOwHICwvT8ysxIf62++P0qy8mG2hMUYabaItdYg= X-Google-Smtp-Source: ABdhPJwthElKzZK3kjRZH0zZT4O6d2XEpLdneazKVUshyg/CwXnNHYlFm+wCjWrrSgz/MuXGYibvmMM3Wn08E6NAVyk= X-Received: by 2002:ac2:5142:: with SMTP id q2mr8269455lfd.545.1625466149445; Sun, 04 Jul 2021 23:22:29 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x12d.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 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" Xref: news.gmane.io gmane.emacs.help:131474 Archived-At: On Mon, Jul 5, 2021 at 1:11 PM Jean Louis wrote: > > * Hongyi Zhao [2021-07-05 05:17]: > > On Mon, Jul 5, 2021 at 12:19 AM Emanuel Berg via Users list for the > > GNU Emacs text editor wrote: > > > > > > Hongyi Zhao wrote: > > > > > > > I've noticed there are some similar functions, i.e., append, > > > > push, and add-to-list, for revising/updating the content of > > > > a list. But I'm still not so clear on the specific use > > > > scenarios for them. Consider the following command [1] > > > > > > `nconc', `cl-pushnew', (setq lst `(,@lst el)) ... > > > > Does the following append `el' to `lst'? > > > > (defvar lst '()) =E2=87=92 lst > (equal '() nil) t So, I would rather write it like this: (defvar lst nil) HY > (setq lst `(,@lst el)) =E2=87=92 (el) > > lst =E2=87=92 (el) > > I see it does when variable `list' is defined in advance. > > -- > Jean > > Take action in Free Software Foundation campaigns: > https://www.fsf.org/campaigns > > In support of Richard M. Stallman > https://stallmansupport.org/ --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China