From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Fri, 17 Nov 2023 09:12:35 +0200 Message-ID: <838r6wq2e4.fsf@gnu.org> 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> <28c63f9b-ae93-551a-a60a-2ed1cda465af@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16776"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, gerd.moellmann@gmail.com, joaotavora@gmail.com, 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 08:12:59 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 1r3t2A-00048L-O8 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Nov 2023 08:12:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3t20-0002RR-DO; Fri, 17 Nov 2023 02:12:48 -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 1r3t1y-0002Ql-B6 for emacs-devel@gnu.org; Fri, 17 Nov 2023 02:12:46 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3t1u-0008WO-4u; Fri, 17 Nov 2023 02:12:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=nGcRRnc2U5UydYzZg9kWRlZroEpV21XBZKSEvQsa6xU=; b=rtBI2vaG+k/D90qZVti+ r73gI5PJAFwVHjKJHWKUX1bZU1HXXVAXEbb66F32sILvTAu3paFX2MEAbuaPF8aePRkAjhx6mwk2u v8fwgHDUdHaqIqiUNPMb452QTom8Ow4aWPpS4nFlAn/cjz8EYsM0IABpZYsceyQhTrSaIIV6XIP3e VOPJ6jhKtC1Mpz9VUZ4cNvT+db0F/ncGX+Pcc0iXL4Vv7uGYsDH6FIPtXW7Us3kBcsRMBjfXkVnoo Gq4/tPVk7n4nSo0+gLhty9FhYm4qp+G3Wpri65l/f2txejfZ7x4FwBBex7YyC07ev/yunSLeKuGko XcR44ofFi6FR2A==; In-Reply-To: <28c63f9b-ae93-551a-a60a-2ed1cda465af@gutov.dev> (message from Dmitry Gutov on Fri, 17 Nov 2023 04:47:41 +0200) 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:312854 Archived-At: > Date: Fri, 17 Nov 2023 04:47:41 +0200 > Cc: Gerd Möllmann , > João Távora , > Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org > From: Dmitry Gutov > > On 17/11/2023 04:44, Stefan Monnier wrote: > >> 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. > > Makes sense. Thanks! If this warrants some improvements of the commentary, please feel free to install such improvements. TIA.