emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's missing in ELisp that makes people want to use cl-lib?


From: Eli Zaretskii
Subject: Re: What's missing in ELisp that makes people want to use cl-lib?
Date: Fri, 17 Nov 2023 09:12:35 +0200

> Date: Fri, 17 Nov 2023 04:47:41 +0200
> Cc: Gerd Möllmann <gerd.moellmann@gmail.com>,
>  João Távora <joaotavora@gmail.com>,
>  Eli Zaretskii <eliz@gnu.org>, michael_heerdegen@web.de, emacs-devel@gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]