summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/oclosure.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/oclosure.el')
-rw-r--r--lisp/emacs-lisp/oclosure.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/oclosure.el b/lisp/emacs-lisp/oclosure.el
index 19e0834ba05..4da8e61aaa7 100644
--- a/lisp/emacs-lisp/oclosure.el
+++ b/lisp/emacs-lisp/oclosure.el
@@ -51,7 +51,7 @@
;; - coercion wrappers, as in "Threesomes, with and without blame"
;; https://dl.acm.org/doi/10.1145/1706299.1706342, or
;; "On the Runtime Complexity of Type-Directed Unboxing"
-;; http://sv.c.titech.ac.jp/minamide/papers.html
+;; https://sv.c.titech.ac.jp/minamide/papers.html
;; - An efficient `negate' operation such that
;; (negate (negate f)) returns just `f' and (negate #'<) returns #'>=.
;; - Autoloads (tho currently our bytecode functions (and hence OClosures)
@@ -139,12 +139,15 @@
(:include cl--class)
(:copier nil))
"Metaclass for OClosure classes."
+ ;; The `allparents' slot is used for the predicate that checks if a given
+ ;; object is an OClosure of a particular type.
(allparents nil :read-only t :type (list-of symbol)))
(setf (cl--find-class 'oclosure)
(oclosure--class-make 'oclosure
- "The root parent of all OClosure classes"
- nil nil '(oclosure)))
+ "The root parent of all OClosure types"
+ nil (list (cl--find-class 'function))
+ '(oclosure)))
(defun oclosure--p (oclosure)
(not (not (oclosure-type oclosure))))
@@ -350,6 +353,7 @@ MUTABLE is a list of symbols indicating which of the BINDINGS
should be mutable.
No checking is performed."
(declare (indent 3) (debug (sexp (&rest (sexp form)) sexp def-body)))
+ (cl-assert lexical-binding) ;Can't work in dynbind dialect.
;; FIXME: Fundamentally `oclosure-lambda' should be a special form.
;; We define it here as a macro which expands to something that
;; looks like "normal code" in order to avoid backward compatibility
@@ -433,7 +437,7 @@ This has 2 uses:
- For compiled code, this is used as a marker which cconv uses to check that
immutable fields are indeed not mutated."
(if (byte-code-function-p oclosure)
- ;; Actually, this should never happen since the `cconv.el' should have
+ ;; Actually, this should never happen since `cconv.el' should have
;; optimized away the call to this function.
oclosure
;; For byte-coded functions, we store the type as a symbol in the docstring
@@ -569,7 +573,7 @@ This has 2 uses:
(defun cconv--interactive-helper (fun if)
"Add interactive \"form\" IF to FUN.
Returns a new command that otherwise behaves like FUN.
-IF should actually not be a form but a function of no arguments."
+IF can be an ELisp form to be interpreted or a function of no arguments."
(oclosure-lambda (cconv--interactive-helper (fun fun) (if if))
(&rest args)
(apply (if (called-interactively-p 'any)