[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: |
Gerd Möllmann |
|
Subject: |
Re: What's missing in ELisp that makes people want to use cl-lib? |
|
Date: |
Wed, 15 Nov 2023 20:56:06 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Dmitry Gutov <dmitry@gutov.dev> writes:
> my observations say that method dispatch simply becomes slower as soon
> as a generic function gets a second implementation. And that
> implementation might arrive from any third-party code.
To me that observation makes a lot of sense, extrapolating from PCL. It
means that Emacs does an optimization that PCL also does. PCL being the
CLOS implementationof CMUCL/SBCL.
In the most general case, the function definition of a generic function
is a discriminating function which dispatches to effective method
functions based on actual argument types etc. Each effective method
function then calls the applicable method functions.
In the case that there is only 1 method, Emacs seems to arrange for that
method function to be used as function definition of the generic
function (I'm a bit simplifying here). So it avoids both using a
discrimating functions, and an effective method function.
In the case of more than one method, using a discrimating function
cannot possibly be avoided, but I'd expect that Emacs is still able to
avoid effective method functions. The emfs cannot possibly be avoided
when there is more than 1 applicable method.
Pretty impressive, actually. Hats off to Stefan!
- Re: What's missing in ELisp that makes people want to use cl-lib?, (continued)
- Re: What's missing in ELisp that makes people want to use cl-lib?, Dmitry Gutov, 2023/11/14
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?, Dmitry Gutov, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?, Dmitry Gutov, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?,
Gerd Möllmann <=
- Re: What's missing in ELisp that makes people want to use cl-lib?, Dmitry Gutov, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/15
- Re: What's missing in ELisp that makes people want to use cl-lib?, Gerd Möllmann, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Michael Heerdegen, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Gerd Möllmann, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Gerd Möllmann, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Gerd Möllmann, 2023/11/17