[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generic functions: Specializers like `or' or `memq'?
From: |
Stefan Monnier |
Subject: |
Re: Generic functions: Specializers like `or' or `memq'? |
Date: |
Sat, 06 Nov 2021 19:29:02 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Emanuel Berg via Users list for the GNU Emacs text editor [2021-11-05 22:36:25]
wrote:
> Stefan Monnier via Users list for the GNU Emacs text editor wrote:
>>> My earliest confusion began when I decided that if I could
>>> find the part of the code that runs the `eql' specializer
>>> (or do we call it the `eql' generalizer?) and then worked
>>> back from there, I would be able to make sense of
>>> everything. But I couldn't even find the bit of code that
>>> looks like (eql <val> <tag>)! And still can't.
>>
>> Nah, that would be too easy. Instead it happens implicitly
>> via a lookup in a hash-table.
>>
>> I suspect that the code for cl-defstruct specializer might
>> be easier to understand in this respect.
>
> What's the typical use case for this?
Not sure what "this" refers to. If you're talking about the use case
for adding new specializers/generalizers, it's quite rare.
It's mostly a detail of `cl-generic.el` used internally.
Stefan
- Re: Generic functions: Specializers like `or' or `memq'?, (continued)
- Re: Generic functions: Specializers like `or' or `memq'?, Michael Heerdegen, 2021/11/06
- Re: Generic functions: Specializers like `or' or `memq'?, Stefan Monnier, 2021/11/06
- Re: Generic functions: Specializers like `or' or `memq'?, Michael Heerdegen, 2021/11/06
- Re: Generic functions: Specializers like `or' or `memq'?, Stefan Monnier, 2021/11/21
- Re: Generic functions: Specializers like `or' or `memq'?, Michael Heerdegen, 2021/11/23
Re: Generic functions: Specializers like `or' or `memq'?, Eric Abrahamsen, 2021/11/04