From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dr Rainer Woitok Newsgroups: gmane.emacs.help Subject: Re: Easy to add with push but not to the end of a list Date: Tue, 29 Nov 2022 12:17:53 +0100 Message-ID: <25477.60001.459031.211780@tux.local> References: <87k03e97fg.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33364"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , 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 12:18:33 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 1ozydF-0008Ol-11 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 12:18:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozycm-0005TB-5h; Tue, 29 Nov 2022 06:18:04 -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 1ozyck-0005R3-Dn for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 06:18:02 -0500 Original-Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozyci-0007ll-T9 for help-gnu-emacs@gnu.org; Tue, 29 Nov 2022 06:18:02 -0500 Original-Received: by mail-ed1-x530.google.com with SMTP id z20so19265610edc.13 for ; Tue, 29 Nov 2022 03:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:subject:to:date:message-id :content-transfer-encoding:mime-version:from:from:to:cc:subject:date :message-id:reply-to; bh=9YwU/Gxhublvrw4XqhqXlbBKTdBJ9eT3YXtkP1qpTOA=; b=B2Z9jTnos1R3bdZ9CoUyYKSHXp7wi0DHaTV8D3AaqO5aw3WQhrTu2UoKWgtTrdzTfL VZcbKYFuPJYln1xSN8Lad+aKCxSInHteyeOHLLboX9yDQUSIprgqli2Umy8vIJB4t62S 8hYjnsfANwAUvN27PYjY1/PC9XAeSQkEpUkmtFXiKnPb+uNj+gQZ7KpQoLgzppGUe8TR rnuEg7nHSOro0PU6DDbrWbnzHwq4HWTuFA1RzieMZ7sXQJyIAXgq8ij3vjHMr2uWdQ6z wT0MHz/lv7ya2D9Ivdx4/gWPegGcy2njAto87CPBrf7iONfDITN90U4ne5Na/NLvmCMd GVGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:subject:to:date:message-id :content-transfer-encoding:mime-version:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9YwU/Gxhublvrw4XqhqXlbBKTdBJ9eT3YXtkP1qpTOA=; b=vvXpUtAlDNLxsbixGPT87gRiKpCm/otWVBIyUGko/ilz2OQXZMQ0dZ0vGUyll8Ux6D 6O5HlmskelqE0aR+96APxQqw/OXAPS9ew58YacsXUuotXmHPYenvtMBxo6OEfKlA2KNq vP0buX24RRPfmYGy4IOYNwflnVRxIyag2uLWFcLg/fOuUW1ArZBIGxRVpvCjwTIkt5OB ozFsUKWR3bP9/xgbKPsk8LVas7e3yDgyDtHRXMGMd72EiASInZGaDAf2+mabTNWf0iei yeOuLwwRcZDDtAfTrEYxpCRLSYzzcbRuPJ0/Y8rKY25Wkl/8MQvDHpelMmLQ6gfshKWK lwZg== X-Gm-Message-State: ANoB5pmv7pYcQdmDxqKfiwWY57z4q/s0FMy2wWdTXgKVBV7I509PeHXz B0BzOKxDBLdnH0o91rJ8Hfc= X-Google-Smtp-Source: AA0mqf7KU0wnNewJSmLhg2lL8mm/D5pfwKmVJuGf1d6BjXj5k3sLP7lQkuRj/5ZnnI9tbakNfeJvuw== X-Received: by 2002:a05:6402:1943:b0:46a:e4cd:5204 with SMTP id f3-20020a056402194300b0046ae4cd5204mr1955419edz.402.1669720678633; Tue, 29 Nov 2022 03:17:58 -0800 (PST) Original-Received: from gmail.com (p200300df071dd61a5ab495f25597d6fa.dip0.t-ipconnect.de. [2003:df:71d:d61a:5ab4:95f2:5597:d6fa]) by smtp.gmail.com with ESMTPSA id 20-20020a170906319400b007bc30c06aa1sm5434229ejy.186.2022.11.29.03.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 03:17:58 -0800 (PST) X-Google-Original-From: Dr Rainer Woitok In-Reply-To: Msg <87k03e97fg.fsf@dataswamp.org> of 2022-11-28 20:59:31 +0100 from incal@dataswamp.org X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta34) "kale" XEmacs Lucid (x86_64-pc-linux) Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=rainer.woitok@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 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, NICE_REPLY_A=-0.257, 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.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:141239 Archived-At: Emanuel, On Monday, 2022-11-28 20:59:31 +0100, you wrote: > ... > (defun push-last (elem lst) > (when (listp lst) > (setcdr (last lst) (list elem)) > lst) ) I think (push-last 1 nil) would fail with an error message. But apart from the error checking, why not just use (nconc lst (list elem)) Sincerely, Rainer