[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/oclosure a444d85977 08/25: Fix bootstrap problems and various mi
From: |
Stefan Monnier |
Subject: |
scratch/oclosure a444d85977 08/25: Fix bootstrap problems and various misc issues found along the way |
Date: |
Fri, 31 Dec 2021 15:40:57 -0500 (EST) |
branch: scratch/oclosure
commit a444d859770cb8b461f27870d3c95e03edbbe8d7
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Fix bootstrap problems and various misc issues found along the way
* lisp/simple.el (function-docstring): Fix call to `signal`.
* lisp/emacs-lisp/oclosure.el (oclosure--define): Use
`cl-deftype-satisfies`.
* lisp/emacs-lisp/cl-generic.el (cl--generic-prefill-dispatchers):
Bind `cl--generic-compiler` around the right part of the function (duh!).
---
lisp/emacs-lisp/cl-generic.el | 24 ++++++++++++++----------
lisp/emacs-lisp/oclosure.el | 5 ++---
lisp/simple.el | 2 +-
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index ba15470751..5e468cd022 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -880,16 +880,20 @@ those methods.")
(setq arg-or-context `(&context . ,arg-or-context)))
(unless (fboundp 'cl--generic-get-dispatcher)
(require 'cl-generic))
- (let ((fun (cl--generic-get-dispatcher
- `(,arg-or-context
- ,@(apply #'append
- (mapcar #'cl-generic-generalizers specializers))
- ,cl--generic-t-generalizer)))
- ;; When compiling `cl-generic' during bootstrap, make sure
- ;; we prefill with compiled dispatchers even though the loaded
- ;; `cl-generic' is still interpreted.
- (cl--generic-compiler
- (if (featurep 'bytecomp) #'byte-compile cl--generic-compiler)))
+ (let ((fun
+ ;; Let-bind cl--generic-dispatchers so we *re*compute the function
+ ;; from scratch, since the one in the cache may be non-compiled!
+ (let ((cl--generic-dispatchers (make-hash-table))
+ ;; When compiling `cl-generic' during bootstrap, make sure
+ ;; we prefill with compiled dispatchers even though the loaded
+ ;; `cl-generic' is still interpreted.
+ (cl--generic-compiler
+ (if (featurep 'bytecomp) #'byte-compile cl--generic-compiler)))
+ (cl--generic-get-dispatcher
+ `(,arg-or-context
+ ,@(apply #'append
+ (mapcar #'cl-generic-generalizers specializers))
+ ,cl--generic-t-generalizer)))))
;; Recompute dispatch at run-time, since the generalizers may be slightly
;; different (e.g. byte-compiled rather than interpreted).
;; FIXME: There is a risk that the run-time generalizer is not equivalent
diff --git a/lisp/emacs-lisp/oclosure.el b/lisp/emacs-lisp/oclosure.el
index 6015e32b91..4fafa1ac46 100644
--- a/lisp/emacs-lisp/oclosure.el
+++ b/lisp/emacs-lisp/oclosure.el
@@ -180,11 +180,10 @@
(defun oclosure--define (class pred)
(let* ((name (cl--class-name class))
- (predname (intern (format "oclosure--%s-p" name)))
- (type `(satisfies ,predname)))
+ (predname (intern (format "oclosure--%s-p" name))))
(setf (cl--find-class name) class)
(defalias predname pred)
- (put name 'cl-deftype-handler (lambda () type))))
+ (put name 'cl-deftype-satisfies predname)))
(defmacro oclosure-lambda (type fields args &rest body)
(declare (indent 3) (debug (sexp (&rest (sexp form)) sexp def-body)))
diff --git a/lisp/simple.el b/lisp/simple.el
index 09e1c7d845..ffb1331e6a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2343,7 +2343,7 @@ FUNCTION is expected to be a function value rather than,
say, a mere symbol."
;; in the function body, so reject them if they are last.
(cdr body))
doc)))
- (_ (signal 'invalid-function))))
+ (_ (signal 'invalid-function (list function)))))
(cl-defgeneric interactive-form (cmd)
"Return the interactive form of CMD or nil if none.
- branch scratch/oclosure created (now de320e2003), Stefan Monnier, 2021/12/31
- scratch/oclosure 5574871ec7 09/25: nadvice.el: Use OClosures rather than handmade bytecodes, Stefan Monnier, 2021/12/31
- scratch/oclosure f11349ed20 03/25: * lisp/emacs-lisp/cl-generic.el: Use OClosure for `cl-next-method-p`, Stefan Monnier, 2021/12/31
- scratch/oclosure 230617c90c 16/25: lisp/emacs-lisp/oclosure.el: Signal errors for invalid code, Stefan Monnier, 2021/12/31
- scratch/oclosure e052bb2770 04/25: * lisp/kmacro.el: Use OClosure instead of messing with internals, Stefan Monnier, 2021/12/31
- scratch/oclosure ae493f3513 01/25: OClosure: Hybrids between functions and defstructs, Stefan Monnier, 2021/12/31
- scratch/oclosure ae0bfc4f75 05/25: * lisp/loadup.el (oclosure): Load before `nadvice`, Stefan Monnier, 2021/12/31
- scratch/oclosure afa68def26 11/25: cl-print.el: Dispatch on `advice` type, Stefan Monnier, 2021/12/31
- scratch/oclosure fe5457ff75 19/25: oclosure.el (oclosure-lambda): Change calling convention, Stefan Monnier, 2021/12/31
- scratch/oclosure d93b0ad4d4 06/25: (interactive-form, function-docstring): New generic functions, Stefan Monnier, 2021/12/31
- scratch/oclosure a444d85977 08/25: Fix bootstrap problems and various misc issues found along the way,
Stefan Monnier <=
- scratch/oclosure f44ee8cd53 17/25: oclosure.el (accessor): New type, Stefan Monnier, 2021/12/31
- scratch/oclosure 55a8e92413 20/25: oclosure.el: Add support for mutable slots, Stefan Monnier, 2021/12/31
- scratch/oclosure bc1d94a0d8 21/25: * lisp/emacs-lisp/oclosure.el (Commentary:): Add a few notes, Stefan Monnier, 2021/12/31
- scratch/oclosure 263172dbfb 02/25: lisp/emacs-lisp/oclosure.el: Make it available to cl-generic, Stefan Monnier, 2021/12/31
- scratch/oclosure 3119e59252 07/25: lisp/emacs-lisp/oclosure.el: Rename `oclosure-make` to `oclosure-lambda`, Stefan Monnier, 2021/12/31
- scratch/oclosure 9465a7e59e 10/25: nadvice.el: Restore interactive-form handling, Stefan Monnier, 2021/12/31
- scratch/oclosure 3c9d64b602 14/25: cl-macs.el (cl--transform-lambda): Fix last change, Stefan Monnier, 2021/12/31
- scratch/oclosure 01002ebba0 18/25: oclosure.el (oclosure-define): Use `oclosure--copy` to define accessors, Stefan Monnier, 2021/12/31
- scratch/oclosure 20e5cd82ae 13/25: Fix bug#28557, Stefan Monnier, 2021/12/31
- scratch/oclosure 44dbab47f7 23/25: * lisp/emacs-lisp/oclosure.el: Remove obsolete comment, Stefan Monnier, 2021/12/31