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 02:46:06 +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="15860"; 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 01:47: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 1r344D-0003wZ-MN for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Nov 2023 01:47:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r342x-0001gi-Ko; Tue, 14 Nov 2023 19:46:23 -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 1r342q-0001gR-BR for emacs-devel@gnu.org; Tue, 14 Nov 2023 19:46:17 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r342n-0001Ur-Mt; Tue, 14 Nov 2023 19:46:15 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3410B5C0165; Tue, 14 Nov 2023 19:46:11 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 14 Nov 2023 19:46:11 -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= 1700009171; x=1700095571; bh=OAMbnubii1uxJFUin8yFnTwoiPpVCQt6Ues i8ySz9IM=; b=Ck5Y3D0svXU/2DDSfy6W00TSKxgAgJY+JAtve3cdAgdRIK32cAR iz3S7HuGg+J48c+Skmtdu7FcvbECDA7+on/gH5aUx9cV8x4saaIW96Gv6Eatko/R 7Bv92p8ci0+8lcnmfbXqHFpzMOZrVidOhoSXeZrVOebUMvVJlcWxURLCtKqSwXwT AWD7NORHEMjyH9P8kH+dOpDiTtQmqp3fkzyXNAQRNraz0lFQxhgQgiZwdNUUtWwW gdxEqtSKtjEMNg4Qv5+hKbWH/mxDjhd51uWe5YXIXVeEGsiWX63k9co7NaxioZPr 5IfZ2xEWSJ9lLgiQgirCS6oHsYy3MWSoRLA== 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= 1700009171; x=1700095571; bh=OAMbnubii1uxJFUin8yFnTwoiPpVCQt6Ues i8ySz9IM=; b=w2Y8cN74LbMo08L01HFhLKV9zCZGbqxgpBDkayc0NxCxR0ELfBN IkQYlhtyJUSrKUuHXqNfYu72CqtKOgfsLD83/NgIF/ioZc3xVl5qj1+LlW1GewHf y253txZ7z4FakKKLUGO6f+z3YDYAXGxNotH3fpbbFgaXO0BHD14oz7GdluUD0wHu JcDvJDfVHVtDdS6+J7vRP+AAdWbrrkhHvpo/Yd9vouZ5ecQGqXN+zZTJWTZPPotS oT1rkyYK0ShrHUOiEpnTFhVsiinYyFqtjlZU7xS/gWwy4CoKMe5/Pm2bFthTWNFX DpxlkHU/32vi+td1Ugjx6t4V5ekkeFG/abw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefgedgvdeiucetufdoteggodetrfdotf 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 19:46:09 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.26; envelope-from=dmitry@gutov.dev; helo=out2-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_H3=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:312744 Archived-At: On 15/11/2023 01:52, João Távora wrote: > On Tue, Nov 14, 2023 at 11:11 PM Dmitry Gutov wrote: > >> 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. > > But isn't my method just that? It's a good style, but any specific project's requirements might differ, and libraries often have to get defensive against bad practices, too. > Let's say the methods's is simpler, > like this: > > (cl-defmethod seq-contains-p ((seq my-voodoo-seq) > (elt (eql :secret-voodoo)) &optional _tesfn) > ;; my-voodoo-seq always has :secret-voodoo. > t) > > Hard to be more efficient than that, right? Then I could use > > (seq-difference '(1 2 3 :secret-voodoo 5) (make-a-voodoo-seq)) > > And get any voodoo out. Okay... so a voodoo seq contains the :secret-voodoo keyword (maybe once, maybe several times, but not any other element). Then it must have a seq-do implementation that yields :secret-voodoo one or several times. And then the seq-contains-pred implementation will do right by it (the default one, not the specialization for lists). >> This is not documented, > > You don't say? :-) i think we should get started on documenting all > these ad-hoc rules (sorry but in this case they are quite literally > ad-hoc). Better than nothing, I guess, since as to actually enforcing > them, I think that train has left the station a long time ago and is > now in a voodoo swamp in monkey island. Not sure "enforcing them" is the right phrase: I wonder if there's ever been a change proposed to seq.el which would break them. Anyway, documenting them sounds best. As soon as we can arrive on a phrasing that sounds clear to all interested parties. > Anyway, I'll be back with more custom sequences soon. Please do.