From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Mon, 30 Oct 2023 21:31:41 -0500 Message-ID: <46ab3c7d-d820-4bb4-8ec4-97c614d7c8a0@alphapapa.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27303"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org, stefankangas@gmail.com To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 31 03:32:43 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qxeYc-0006y7-O8 for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Oct 2023 03:32:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxeXn-0003TR-II; Mon, 30 Oct 2023 22:31:51 -0400 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 1qxeXl-0003TB-Ee for emacs-devel@gnu.org; Mon, 30 Oct 2023 22:31:50 -0400 Original-Received: from weasel.tulip.relay.mailchannels.net ([23.83.218.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxeXj-0005Y5-O7; Mon, 30 Oct 2023 22:31:49 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id BEBD0C11B5; Tue, 31 Oct 2023 02:31:43 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a316.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 72C61C187D; Tue, 31 Oct 2023 02:31:43 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1698719503; a=rsa-sha256; cv=none; b=3Mtlaq/XDXlDuZuce/TT0yyDf2GfArzV60VzMr9EhYkF/dwVLwupFxGN4RsdDaKY3ql7vb u6jzK3q1hPgbpc9JCOcVaW2dJ2xXO2uhZg8CMDLeAXYXgmezy3UbWiOXrUXlGGzdlgtlFr pgr+7azbHMXdbB4j3Fa9qGE999iwfVvTEPzwW41l6yoEHmtUFoxy4uftoWt1Y3+fqBOIaa OITm0G7YOKuT7lb91c2EsGYmysf5UhwtsX43GqI87dWbPtB+GIFVgM77hSnKYayxase2FZ XulkPuUG8bCOPP3h5VMsE5aCZ0gST5iXyrZ5Z9jk0m4o+wzTSCIsR951cUGTdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1698719503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qsyg5AG2LfWRc5iAzBLPN8C8fFsGDxUfa4o21OOx5d4=; b=Vp1W7v2FqV3Ihq06jg9Nxa8CHkyvZuURqMx8gY3i9sjHj8hMgFVhxuzrsPKEswhqiYBAAH PO67TLycRO3fXOA7fnZxr7PELxYFhq0Onh+/SoDpxSYuVjERk/soZ5UtgJnn2q2gljl2tV Pi3SSYmrIGdKEreOlHystFuY9kqiQEAFQc8A5GUrHDsIbattEACDNMtnGqlUECAF3BEPzp fvvw2+kO/x0djrkfrcdm6xASpTSwnqXrVRAYeqgq1+ti7qjm4GbpVp8VH2tAM3e1AprKQd BC3CpRl4EyptQ0UfekGBppqEthmdKOgT5V74kIxkfovlqg0Q53sy+pmJ74F0/g== ARC-Authentication-Results: i=1; rspamd-86646d89b6-9q5lf; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Celery-Stretch: 267c95765467bb8b_1698719503604_479982141 X-MC-Loop-Signature: 1698719503604:621177841 X-MC-Ingress-Time: 1698719503604 Original-Received: from pdx1-sub0-mail-a316.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.104.29.7 (trex/6.9.2); Tue, 31 Oct 2023 02:31:43 +0000 Original-Received: from [10.60.1.18] (unknown [193.56.117.222]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a316.dreamhost.com (Postfix) with ESMTPSA id 4SKDfk6jFRz3Z; Mon, 30 Oct 2023 19:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1698719503; bh=qsyg5AG2LfWRc5iAzBLPN8C8fFsGDxUfa4o21OOx5d4=; h=Date:To:Cc:Subject:From:Content-Type:Content-Transfer-Encoding; b=GFAninVU67Rb8Q24Q2LfLRB0ucXl6kP+hdTmRa0dtRmoNupNA7JwWB/hkh3b4KcOa 1FYAe8WGuo0EenGSO54q40WF7jPtCBTmWWzQCLB5mFJ6wL+ZXD0EzAKjv+QN4kF4mN NtmIvL02isxkS1Cc2fid8fgV8MMwDxavAcNIBXFA1pUyCTU+QGGq85GWfjTxhfgRLY nMSEv0HsnozG26kx/mTB7/B36dnsLJ3WMoDotGnCsUBVMdGkgLJZprRYuQpzY9/QXO kc5R3Jr1hkTgQyiLUPvu+kPWhWfPLfWawwI+cLZiEpn4kUdjGe/zUpNpfsf5PMZ+fp z+VIddlrbKE1A== Content-Language: en-US In-Reply-To: Received-SPF: neutral client-ip=23.83.218.247; envelope-from=adam@alphapapa.net; helo=weasel.tulip.relay.mailchannels.net X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312007 Archived-At: > Do people really want `cl-pushnew', with its keyword arguments? > Or would a simple `pushnew' be even more pleasing? It might be more aesthetically or ideologically pleasing, but it would be much less useful. :test is often necessary for using EQUAL (as EQ is often the wrong function to use); without it, a hypothetical non-CL PUSHNEW function would often be unusable. And :key makes it easy to use with, e.g. structs' accessor functions (which are very helpful for developers as they allow compile-time checking, completion, etc). When CL-PUSHNEW is called without keyword arguments, it's as simple as a hypothetical non-CL PUSHNEW that offered no keyword arguments. The keyword arguments provide optional flexibility; without them, one would have to write a much larger, more complex form to do the same things. Finally, if there were an additional, non-CL PUSHNEW function added, I would think that would be much more confusing to users, especially new ones, for there to be a difference in behavior between PUSHNEW and CL-PUSHNEW. So I would ask that CL-PUSHNEW become PUSHNEW as-is. > To define `pushnew' in Emacs Lisp, and document it in the Emacs Lisp > Reference Manual, would be much cleaner than spreading the use of > cl-lib to more files. I would be happy to see more cl-lib functions "moved" back into "core" Elisp. Using Elisp without cl-lib feels restrictive to me. By the way, with regard to CL-PUSHNEW, it seems surprising that no one's mentioned the existing counterpart in "core" Elisp, ADD-TO-LIST. Notably, its docstring says: This is handy to add some elements to configuration variables, but please do not abuse it in Elisp code, where you are usually better off using ‘push’ or ‘cl-pushnew’. So even "core", non-cl-lib Elisp recommends the use of some cl-lib functions, i.e. CL-PUSHNEW. That certainly suggests a "gap" in core Elisp functionality. --Adam