From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: [External] : Re: Easy to add with push but not to the end of a list Date: Mon, 28 Nov 2022 21:56:48 +0000 Message-ID: References: <87k03e97fg.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40730"; 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 Mon Nov 28 22:57:16 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 1ozm7n-000APX-Jq for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 28 Nov 2022 22:57:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozm7Y-0004GH-Il; Mon, 28 Nov 2022 16:57:00 -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 1ozm7W-0004Fr-K1 for help-gnu-emacs@gnu.org; Mon, 28 Nov 2022 16:56:58 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozm7U-000121-V1 for help-gnu-emacs@gnu.org; Mon, 28 Nov 2022 16:56:58 -0500 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ASLrQFt001648; Mon, 28 Nov 2022 21:56:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=5SskY69gG3ekNVxAhgb9iKqZYKKrLZnhH1w+mjL74PQ=; b=lYjQYCCevLHb2MTmUbXuB7xfkl9RMg7AwYkyCyaKm+UxJvZv31t/3edNRE4ZaTegrC+J g7UlGHZxRvHAmn+Iv20sv0valALYc062GqAILTWyoT3hhQC8YFblnPxSL/n9HA2PF1Og pPHisdcpO9C/Bu/qT57r7Xwg7LXkrF8DMOeMP35V6EpLHsAc2Vj2gyyNriMoCP9UywhE GCZAv+J2dfQZWCAhj0VKhIpMZc95s1omA+FTTzf4fcNWDxBlrmXT8z5VEqi/X2zJFdja Q/ioYdTfTsuqoljTdsS74nzLnhaMlmIMfA4E17uxWKSxfbOpEsgQF1QkyYanIcac+gKZ lA== Original-Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3m3xht43rd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 21:56:52 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ASKB52W026756; Mon, 28 Nov 2022 21:56:50 GMT Original-Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3m3c1u3bc9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 21:56:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ag3iWT9VeZovt7MvNhgMvUvk2yX12DYnKeWn6fyo6RVhXRq+CeH6tMaDnq6hkWbaiVS391GTpG/Sv46Gx+FnlWxr4XWXOnfkGVCwVsen2emONXBSMr9dimlZdpTDQG+CnfYM2GkSFZt6HBXvf+VRkJv2eo/XESMlClBu8bGEX0KeLMkzgjZi7mB+7fwAfkGtYm8NhhrRgoAMuS0GOrvScBLIjvTWGzThaAhXbTEtssGEqC5gzRE0a6WWe67qtEcNZGvgx3S4aiFf9GGqFsg80JUB1W3VRENG3ktZ8zk4DD6t67ejoX0NQJllwHfw3tspJ8hAk33xRBDZEG7E9xXJ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5SskY69gG3ekNVxAhgb9iKqZYKKrLZnhH1w+mjL74PQ=; b=cf9ze5d7qpbqfJkoDeWASg06Y6ONRieAXpjftNqMifLQiR83A36lH4hXLRmjovyO7T7/1bLmXqHNaeT9Y3qJcXaXCQ72ckThGX6qG+t/Rk82L0EyXLLRIeqsStMkzfjtNWrWeI7Dlle9kONVjWkLx4hIegRVwhvA1mQaFEcQZL+DEBXNziUjwhAasd5B2lU10xNYzpObsg0RUcHzhWc2GSFJS50POOYrbNwR3saVYY/rCW6Pk08ILgqkOlqg4i/PlOQCAk86XrnMuJ7lha6KF2b771e07cET65B2EJmQp5U9Ba3JA90tgNRP2GAJwyY/n8iRAMnLfW4QyWL9xepL+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5SskY69gG3ekNVxAhgb9iKqZYKKrLZnhH1w+mjL74PQ=; b=s6tr0GOP162KlM7FddIQCMBg8vLxLi4bH3z3Sf4DXi3RGFDT6f/bRQWO777QqEydKEBIpdtc33gXOB+m1LTtJtDPkC4ZGPa98uuZlbMWvJPG3JgI+Y7aZQAQC6UriGkjiy5aqi3vv9g4aFmdLWsYFnEMFmi1FWF4GnSZzIaUyxg= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SN4PR10MB5798.namprd10.prod.outlook.com (2603:10b6:806:20d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.22; Mon, 28 Nov 2022 21:56:48 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::6951:297b:f3d5:2588]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::6951:297b:f3d5:2588%9]) with mapi id 15.20.5857.023; Mon, 28 Nov 2022 21:56:48 +0000 Thread-Topic: [External] : Re: Easy to add with push but not to the end of a list Thread-Index: AQHZA3C92JI2WR47DkWLvRpuGkWvga5U3/aA In-Reply-To: <87k03e97fg.fsf@dataswamp.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|SN4PR10MB5798:EE_ x-ms-office365-filtering-correlation-id: a605cea6-daa7-4703-b792-08dad18b72e1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 68mQqjgkxcEsnvsAYQgCx7razKl8Hzs5T4evRV0vJIGV8qg3YYe9qdn08JcR/twEHux+zWLit2kS5+50HS8BljGt3X8DFsnDkiSk+D7jfs7t5QHu7OidmvX/IaUNs3yHHrf/R3zGLfOSIJY3nMjP9vsGlJjgN3OepHITJEC3fcJkiMI9foIupkowifUiJsahZo1JQLh28m+Rd0puPfA0KYC7OmoVU/P9qR4oWGlSSX6z3HMowBIyMy1G9+HZI4HBeBm3qIh3LOjkCcGd3Ct3MXczpn035/mYQznTabJ/KVTwQSzUxmab56T4x65C5C+d/K7GmMEuVVNr73QuUHTtH7JQIyIWJ7gYUbIO2INwid+t5NOX058C6X6aUGK0uviB6nkCW3OFSUtZcZ6XrkPokRv6qpXadYgSo7ecyruyHoFyUcHwMmkvZsIYI0G9/b/vn4kaqAvDENfdqcQpnehQDm6ZHgz7rQI13BNW2o4CoLMnRIv6Go6BWLxmoVNZonenE+MTzG4aecfKRg19hzQhH7zgZR+TCwRFsbzx3wcp6KEElCtOKqtizvwUpgXqL6sqn2npUwLbvhZwlSTtHiVu50LPTj5JdDGumuSTkijheJk1iG6gqwQqtlvPeEO7N6SBPSHJTfj8o7R/JW4ZTq1IOkXJ7iH2Q6AvUqGF33F85MZQw6P4K8vgEHY4/TtHT/8sK/2qJ6s20YcigBcA8HyKIRQ+BinCgg0Lpc6J2/57lnk= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(346002)(396003)(376002)(366004)(451199015)(7696005)(9686003)(2906002)(6506007)(26005)(38100700002)(86362001)(52536014)(44832011)(5660300002)(110136005)(316002)(38070700005)(122000001)(71200400001)(478600001)(8676002)(66446008)(186003)(66476007)(76116006)(64756008)(4744005)(66556008)(8936002)(66946007)(41300700001)(33656002)(55016003)(42463001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DbGk9fWOxDbD2CJJhKR8FvSXIz5YGAXMo7/qslyC1ehG/BcPrcn7HyceJDNU?= =?us-ascii?Q?cYgDxtbmK+277DlEESsFsm1zkcHAbn78dGd2y0n+gkl/AQFh4ntojMR9jK4a?= =?us-ascii?Q?PJ9Z06mtGgpJw059cRUeyxiN8+TEXht1AainOUttc9Jbqx/AEN5qhW5KRIdf?= =?us-ascii?Q?tsYdFb5EOTxXVbapYyFxzzKORtovlrNPdnoeDjo2qeMItPi9j1oVXq9q8BtO?= =?us-ascii?Q?t0X51oRmh8dJ68C6nY6rBCEQJbZ1ds5MhvX/j+/2nhWHwEkPoKkXq0nujmes?= =?us-ascii?Q?jsjuKCpjpixZY210Nt83A9zrJ6NDKrUSQO33gRXgh466hK7kU+VZ5NdN8Qjz?= =?us-ascii?Q?ZFe+Q84Aul6FxoZrK4koVLmmh/0oYjUknDErcrb8nBlWG6eTVWpJjKpVLaMP?= =?us-ascii?Q?Z5kgLCdFyX09rRzZH7J+zN8cJzGCV7bn4zx9bOxEAHzilZWVtALpYS4Eamq2?= =?us-ascii?Q?n2EfWAc1vdK3wI3xJU3zpvxoznIkMparv81v0Zm6L72OAkK5G0504YdFAPD0?= =?us-ascii?Q?Pj07c/KB3b/e6iD2S006fj7441GY0aFwA93dWylRxCDCMDo6ShyzGt3oV8eF?= =?us-ascii?Q?BRzK68rnTaSkgYcm98wiW/57HNhUxy03EAg8eA30KHrF7IKmsJLMleICYeoO?= =?us-ascii?Q?5U X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 4d7vpEbfdnyPqYFLyBmoLREDBtD2kc5a+rpWvEsMAdc8QHkyIXVHtcWLki8tMOQ35xif2F5Bs6JPEYbljzM+9FWHg9kiGQN4pNSqf0H1KPGB3EeaIcq0JQQveoQFyYSrpBxtolm1DTW4RzytrFxgvQ62caYwPcq2aGu64awuGSqqFBocIHPHp3VbucVlk4+ok3zMvCQ0EDpxgjXcx84wE7hQvo1U5+mOpI6hlV0UR/C+SVxRan7IcxdbPKpj+m8suM//zEChMLqNjcdQoMhodWnveuay0O+8N/Tmd8g2FildQB8AsQ//w3AS2YAK4VG2oPhIU1mi2EeylBYCrFe60J5Kj7QxWhTW4D2upz+QxAJFyEMBZl+EwWTMLepPND9jL+5kcBl6ajqxGraj3LazHgH2zZWdSuQ4bySQfIJu4Ug77C0Ynpz1fvIdAO4DOj66JkJru0ywqsUc+QS2VfRWuYAxPco2g+nS5fKsx3JHxCYjVGScp+XszBmADz5/Xtcq6qb8bsK/QGqzzYcQWHCZFH2QA329uUkXfGy9bKIraN/Lh9TeC2fy+fQ9maIRvTFomKamXcLloQSUMneR7I11mxnwtcfFBA9Tn3tNTTcUo2zivJxMpdIjBSExrqd3FitgFBMuTJy9lNuLtT7JqUbl30Xeu3N9B2KlDQkFeg1WX/UZge2zepfe8RuUKXTBMoP2nc2x9dEJcxY+yz+TnZU34hp9G4nRTJHDosDNFu6ydX2kyG 76RtQseRRvlgO/RMdyHkf7mciDlGRZ6k8pJ9C10g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a605cea6-daa7-4703-b792-08dad18b72e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2022 21:56:48.3932 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iasDXQQKZj+1iFfh1DYrbnrmMiZd8Ea0tZvD/SF/0yCQVLh7QKK5sy+AwdVKOcr3ODlO0uaxai+DS0lIn5takw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5798 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_17,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 mlxlogscore=925 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211280157 X-Proofpoint-GUID: 6396bTlI4WD2BZreT9IQImTB6t05eO3N X-Proofpoint-ORIG-GUID: 6396bTlI4WD2BZreT9IQImTB6t05eO3N Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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 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:141226 Archived-At: > I agree there should be such a function in vanilla Emacs. > Maybe something like this? >=20 > (defun push-last (elem lst) > (when (listp lst) > (setcdr (last lst) (list elem)) > lst)) As I said, there are umpteen different meanings / behaviors for "add an element to the end of a list". (setcdr (last lst) (list elem)) is one such behavior. And that's just as succinct as (push-last elem lst), and clearer. It makes crystal clear that you're opting for list modification.