summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sb-eval2.lisp8
1 files changed, 6 insertions, 2 deletions
diff --git a/sb-eval2.lisp b/sb-eval2.lisp
index 763b3fc..6301be9 100644
--- a/sb-eval2.lisp
+++ b/sb-eval2.lisp
@@ -93,8 +93,12 @@
new-context))
(defun prepare-ref (var context)
- (declare (ignore context))
- (lambda (env) (cdr (assoc var (environment-variables env) :test #'eq))))
+ (if (context-var-lexical-p context var)
+ (lambda (env)
+ (cdr (assoc var (environment-variables env) :test #'eq)))
+ (lambda (env)
+ (declare (ignore env))
+ (symbol-value var))))
(defun prepare-function-ref (f context)
(declare (ignore context))