From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Thu, 16 Nov 2023 17:42:52 +0200 Message-ID: References: <12da6bcb-1818-7fbe-12af-8d4607724332@gutov.dev> <87il6bt4z0.fsf@yahoo.com> <8734xetjkk.fsf@yahoo.com> <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <87fs172i62.fsf@gmail.com> <87y1ey1zn9.fsf@gmail.com> <875y21kbnz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6125"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Eli Zaretskii , Michael Heerdegen , emacs-devel@gnu.org To: Augusto Stoffel , =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 16:44:06 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 1r3eXG-0001Rg-DN for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 16:44:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3eWV-0000x8-J9; Thu, 16 Nov 2023 10:43:19 -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 1r3eWT-0000vG-OK for emacs-devel@gnu.org; Thu, 16 Nov 2023 10:43:17 -0500 Original-Received: from forward500c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d500]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3eWK-0001gl-D8; Thu, 16 Nov 2023 10:43:15 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:2ead:0:640:1417:0]) by forward500c.mail.yandex.net (Yandex) with ESMTP id 5EC0D61224; Thu, 16 Nov 2023 18:43:00 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id vgnwYI2OeSw0-M8QDvDZV; Thu, 16 Nov 2023 18:42:59 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1700149379; bh=q4ORvHiTv/uSbwg+TJST0pfOIeJ21OVe3r+zMBubUPc=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=MuhHEVbHMbYBxqIcjTBEGJxdp2WxKdoOqMz7lNe20LuqnXvbvtVb4a99Ps0CAfWK3 oOTxjMKD8mA1Ag5HWLdhUSPTKBvKdC+d43FCY5XMXN6sYAhvgGi21BsqrwEvFCP33s xrbWYDndVc4XsRWKhF+Bmsm/MpToMwUWL44s3ApU= Authentication-Results: mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 8CF5127C0060; Thu, 16 Nov 2023 10:42:57 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 16 Nov 2023 10:42:57 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrth htvghrnheptdffgeegkeelteevtdekleethfeftdduvdegkedtkedujefhfedtveeftdff udevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleeh hedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 10:42:55 -0500 (EST) Content-Language: en-US In-Reply-To: <875y21kbnz.fsf@gmail.com> Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:d500; envelope-from=dgutov@yandex.ru; helo=forward500c.mail.yandex.net X-Spam_score_int: -49 X-Spam_score: -5.0 X-Spam_bar: ----- X-Spam_report: (-5.0 / 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=-2.193, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:312807 Archived-At: On 16/11/2023 16:36, Augusto Stoffel wrote: >> That breaks any sequence type based on lists. This is exactly the >> problem I was raising with too-many-generic interfaces, btw. > Good point. IMO you just can't have both lists and "types based on > lists" to work together properly; if we defined a method for > seq-difference on lists, the issue would be the same (I guess that's the > caveat you raised regarding Dmitri's patch). Actually, we might not allow custom sequences based on lists to begin with. E.g. if there are two definitions (cl-defmethod seq-length ((l (head :m6-sparse))) and (cl-defmethod seq-length ((l list)) ...is there a well-defined ordering between them which would determine the one that will be used for (cons :m6-sparse nil)? If not, the optimization proposed by Augusto should be quite valid. And whatever custom sequences are added later, should use cl-defstruct or similar. >> Try Dmitry's patch instead, the one containing seq-difference-3. > That approach is fine, but it only addresses one function at a time. > (If we go that way, I suggest starting by the most useful ones: > seq-filter, seq-some and seq-reduce.) My patch should help all the set operations (difference, union, intersection). And seq-uniq too. Anyway, there is no reason not to use both optimizations together.