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: Wed, 15 Nov 2023 01:11:02 +0200 Message-ID: References: <8734xetjkk.fsf@yahoo.com> <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <8334xcwank.fsf@gnu.org> <320999cc-6c83-2315-0044-cc0403400af3@gutov.dev> <9ab5d2bd-a648-cae0-a4a7-ae86be10af0f@gutov.dev> <87r0kuqxbf.fsf@gmail.com> <54e115a2-fc36-3056-a030-0dbf32416ddb@gutov.dev> <43f290b0-4119-597b-c89a-0fb4c7db1665@gutov.dev> 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="37934"; 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: =?UTF-8?Q?Gerd_M=c3=b6llmann?= , Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 15 00:12:12 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 1r32Zl-0009bT-Uf for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Nov 2023 00:12:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r32Ys-0007BD-Rw; Tue, 14 Nov 2023 18:11:14 -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 1r32Yr-0007AX-CX for emacs-devel@gnu.org; Tue, 14 Nov 2023 18:11:13 -0500 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r32Yp-0007eU-Lb; Tue, 14 Nov 2023 18:11:13 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id CD754320024A; Tue, 14 Nov 2023 18:11:08 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 14 Nov 2023 18:11:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1700003468; x=1700089868; bh=gzTKjP/cPOe+2eGPwGkaxJAOJwKocjlqZBX SYxmH6/U=; b=i5z7cYh1p+HQ+8rCHq9JqmzPImhiRbluuGctKO9AB/EUFuqjbG3 3pD9ypMcUKJKA6i+N2DlHbBUJ1EgtwCnGGvwvAJiTmezMOtOTonLyW2L4jOyZk3M 1wy12fr3GymaAOZO/x+IbYIBSV2lNHQDuut968hp5Z4HqX7Qn/BD1VIXsT69RKvj 2bNL7NlNDTXfHLKkfUI/RzmfVrjP1Ml5gDhJSPxJukuOLfV4IWtSJZlj5p07+u7B /1fLOdfbtGsyQ9WwkClxkUIIrsNEqBnfWUuFz/uXusbSwENAT3O8X8rR+9K2KnIS ibpzXfFVv6poc3HN17tAZ2fHVQ6VyaU99Iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1700003468; x=1700089868; bh=gzTKjP/cPOe+2eGPwGkaxJAOJwKocjlqZBX SYxmH6/U=; b=V7SMVJxYtpZk24MjDsGOaq6h1lG6S5M4gkw9MEQ2vzWm6qPqtc2 fp1Q6mQx8BuVyiTl+S7SfYF8j99TXjTQ4B8SMBLJYiazCmR7s8LsOpJ0uosQoIoL Yp990jMdsZpl0oxcf9mxXP0EO5pHAIfLtQUeZtjwZtnSGetrh8yE7LEDVei1dTUS N7wOqZxXPuCSWnlXWmSgURinBdvEREZWFF3cOKsUFZS0RHIvi+TXWaWNPdXl0HP2 ONIKvl/lzpyaSgX7QUjfa5IJ5grQoANtL3rRumV2QV+h6UWC1I6JAuNfLQd62J+A xWTjFueyy1hfcQKf4r/2A/TuTyeyprfptIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Nov 2023 18:11:06 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.25; envelope-from=dmitry@gutov.dev; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -64 X-Spam_score: -6.5 X-Spam_bar: ------ X-Spam_report: (-6.5 / 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, NICE_REPLY_A=-3.695, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:312741 Archived-At: On 14/11/2023 04:27, João Távora wrote: > This is all interesting, until one ponders what happens if an existing > seq.el user somewhere has: > > (cl-defmethod seq-contains-p ((seq my-voodoo-seq) >                               (elt (eql :secret-voodoo)) &optional _tesfn) >   (invoke-voodoo-priests seq)) > > making use of seq.el's support for abstract polymorphic sequences. > > With seq.el 2.24 a seq-difference operation would consider this user's > method, with seq.el 2.24.dmitry (i.e. your fast seq-difference-3) it > simply won't.  This user's code is clearly broken. > > But was the user allowed to do that in the first place?  If not, > why is seq-contains-p a public generic function? Allow me to try to answer this again: special voodoo is probably not allowed. What the specialized methods are supposed to do is implement the same logic (described in the generic function's docstring) but in a more efficient manner. So the author of the new data type (who works on the implementation of seq-do and specialized methods) is responsible for making sure the new definition is equivalent but faster. This is not documented, but seems to hold for all the code in the package. If someone found a case where violating the above rule would be helpful for a certain practical purpose, we could discuss it. Note that all the functions in seq.el are currently non-destructive or perhaps even "pure", so it's not like there could be something special done to the input data behind the scenes, aside from what's in the contract (data in + data out).