Subject: bug#54802: OClosure: Make `interactive-form` a generic function

From: Stefan Monnier <[email-masked]>
Date: Thu, 14 Apr 2022 23:24:23 -0400

>> Part of the 2x slowdown is due to generic dispatch but part is due to
>> the fact the code is in ELisp rather than in C, so even a "perfectly
>> fast" generic dispatch wouldn't get us back the factor 2x.
>> And speeding up generic dispatch is not super easy.
>
> Hmm, so what about having a special "OClosure" pseudovector type on the
> C level which would otherwise behave like byte-code functions, but
> behave specially in `interactive-form'?

I can do a sort of `oclosurep` from C already.  But that doesn't
guarantee that the OClosure has an interactive form, so in the case we
match `oclosurep` I'd still need to call another function from the ELisp
world (that's the one I called `generic-interactive-form` since it would
most naturally be a generic function) because it'd be inconvenient to
figure out from C if that OClosure has an interactive-form (and where it
is).

        Stefan