From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Thu, 16 Nov 2023 21:44:24 -0500 Message-ID: References: <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> <1e7fe1ef-af7d-3222-7b9e-b569b3c97ccf@gutov.dev> <22e4cb4d-a8f3-1530-881d-b8c59c5d969b@gutov.dev> <339b58d6-5a44-8393-c2cd-4c935147dde3@gutov.dev> <877cmhrcsf.fsf@gmail.com> <56accb10-2a3c-7670-1687-4ae1d7e374e8@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19614"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Gerd =?windows-1252?Q?M=F6llmann?= , =?windows-1252?B?Sm/jbyBU4XZvcmE=?= , Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 17 03:45:17 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 1r3or6-0004vQ-92 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Nov 2023 03:45:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3oqO-0000Ay-JU; Thu, 16 Nov 2023 21:44:32 -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 1r3oqM-0000Ab-8j for emacs-devel@gnu.org; Thu, 16 Nov 2023 21:44:30 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3oqK-00078w-HO; Thu, 16 Nov 2023 21:44:30 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5FF35807A7; Thu, 16 Nov 2023 21:44:26 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700189065; bh=a9h+h85ZzPT+zbMBGko2s3rs5n/1e3Mhr0dhgWa0tnU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=N6XmOX9ZoJpxmuMnQl8M2aBeZzve9LV0F5bAqd+9Xr21qSCBlFmIbEg7QWBiPTyFB vUOodjVL5svQ3szAXPIfY4Z4L3ouzHNADrupSfzrNzUwGrRy3PNjHukoCxPZLjzT5i fBx9TPqlg69Ugjnzk9A0jf0+RpstG5TEr++HjcCLJ5BckvEKLOevt6040X6KjkLcAO pNA9yshNzELI75UXLxGzHICYOw5+845d7ornAu1O8X5Bzt6Fn+0lFdwQCmJ6NEzgYr iG2NpKiW4h75SF3huUr9itvd5hxBpvS8inHvaRa4cwVnFmVHJB3HiZAV0RfElw9nKo iUe+ajvADVf9A== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8D493802CD; Thu, 16 Nov 2023 21:44:25 -0500 (EST) Original-Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5171B1201D0; Thu, 16 Nov 2023 21:44:25 -0500 (EST) In-Reply-To: <56accb10-2a3c-7670-1687-4ae1d7e374e8@gutov.dev> (Dmitry Gutov's message of "Thu, 16 Nov 2023 23:54:01 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:312842 Archived-At: > But cl-defmethod with just one method resulting in a simple function > definition in an experimental fact (evaluate (cl-defmethod abc () 345); > then (cl-defmethod abc () 345) returns (lambda nil (progn 345))), so that > must be faster, without any computation of applicable methods. "one method" is necessary but not sufficient for this optimization. This one method has to have no specializer (aka only the `t` specializer). > The comment above the code you quoted mentions "generic functions with > a single method"; maybe it was written before the above optimization > was made. No, that comment refers to the case where there's a single method but with a non-t specializer, so we can't just always call that one method without first testing that the arg matches the specializer. Stefan