summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sb-eval2.lisp13
1 files changed, 9 insertions, 4 deletions
diff --git a/sb-eval2.lisp b/sb-eval2.lisp
index 8105cd6..0567318 100644
--- a/sb-eval2.lisp
+++ b/sb-eval2.lisp
@@ -182,10 +182,15 @@
(declaim (ftype (function ((or symbol list) list context) eval-closure) prepare-global-call))
(defun prepare-global-call (f args context)
- (let ((f* (fdefinition f))
- (args* (mapcar (lambda (form) (prepare-form form context)) args)))
- (lambda (env)
- (apply f* (mapcar (lambda (x) (funcall (the eval-closure x) env)) args*)))))
+ (let ((args* (mapcar (lambda (form) (prepare-form form context)) args)))
+ (if (fboundp f)
+ (let ((f* (fdefinition f)))
+ (lambda (env)
+ (apply f*
+ (mapcar (lambda (x) (funcall (the eval-closure x) env)) args*))))
+ (lambda (env)
+ (apply (fdefinition f)
+ (mapcar (lambda (x) (funcall (the eval-closure x) env)) args*))))))
(declaim (ftype (function (eval-closure list context) eval-closure) prepare-direct-call))
(defun prepare-direct-call (f args context)