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: Dmitry Gutov
Subject: Re: What's missing in ELisp that makes people want to use cl-lib?
Date: Fri, 17 Nov 2023 04:47:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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!



reply via email to

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