]> git.eshelyaron.com Git - emacs.git/commit
cl-generic: Use OClosures for `cl--generic-isnot-nnm-p`
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 30 Mar 2022 17:54:56 +0000 (13:54 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 30 Mar 2022 21:08:28 +0000 (17:08 -0400)
commit6f973faa912a5ac1ba643c6f5deb0c02baa0ba6d
tree96071fd19e3863ec34b4d32235e573d9106bf1b2
parentb12ad270ebffb2b048f01d2992b472503b78dc33
cl-generic: Use OClosures for `cl--generic-isnot-nnm-p`

Rewrite the handling of `cl-no-next-method` to get rid of the hideous
hack used in `cl--generic-isnot-nnm-p` and also to try and move
some of the cost to the construction of the effective method rather
than its invocation.  This speeds up method calls measurably when
there's a `cl-call-next-method` in the body.

* lisp/loadup.el ("emacs-lisp/oclosure"): Load.

* lisp/emacs-lisp/oclosure.el (oclosure-define): Remove workaround now
that we're preloaded.

* lisp/emacs-lisp/cl-generic.el (cl--generic-method): Rename `uses-cnm`
to `call-con` to reflect it's not a boolean any more.
(cl-defmethod): Adjust to the new name and new values.
(cl-generic-define-method): Adjust to the new name.
(cl--generic-lambda): Use the new `curried` calling convention.
(cl--generic-no-next-method-function): Delete function.
(cl--generic-nnm): New type.
(cl-generic-call-method): Rewrite to support the various
calling conventions.
(cl--generic-nnm-sample, cl--generic-cnm-sample): Delete consts.
(cl--generic-isnot-nnm-p): Rewrite using `oclosure-type`.
(cl--generic-method-info): Add support for new calling convention.
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/oclosure.el
lisp/loadup.el