0.9.2.26: refactoring internals of foreign linkage
[sbcl.git] / src / code / eval.lisp
index 9a3cdf1..b33ca52 100644 (file)
@@ -20,7 +20,7 @@
   ;; to be careful about not muffling warnings arising from inner
   ;; evaluations/compilations, though [e.g. the ignored variable in
   ;; (DEFUN FOO (X) 1)].  -- CSR, 2003-05-13
-  (let ((fun (sb!c:compile-in-lexenv (gensym "EVAL-TMPFUN-")
+  (let ((fun (sb!c:compile-in-lexenv nil
                                     `(lambda () ,expr)
                                     lexenv)))
     (funcall fun)))
@@ -70,7 +70,7 @@
              (sb!c::process-decls decls
                                   vars
                                   nil
-                                  lexenv))))
+                                  :lexenv lexenv))))
       (eval-progn-body body lexenv))))
 
 (defun eval (original-exp)
@@ -94,9 +94,9 @@
              (progn
                (signal c)
                nil)
-             ;; ... if we're not in the compiler, better signal a
-             ;; program error straight away.
-             (invoke-restart 'sb!c::signal-program-error)))))
+             ;; ... if we're not in the compiler, better signal the
+             ;; error straight away.
+             (invoke-restart 'sb!c::signal-error)))))
     (let ((exp (macroexpand original-exp lexenv)))
       (typecase exp
        (symbol
                (if (and (legal-fun-name-p name)
                         (not (consp (let ((sb!c:*lexenv* lexenv))
                                       (sb!c:lexenv-find name funs)))))
-                   (fdefinition name)
+                   (%coerce-name-to-fun name)
                    (%eval original-exp lexenv))))
             ((quote)
              (unless (= n-args 1)
                         ((null (cddr args))
                          ;; We duplicate the call to SET so that the
                          ;; correct value gets returned.
-                         (set (first args) (eval (second args))))
-                      (set (first args) (eval (second args)))))
+                         (set (first args) (eval-in-lexenv (second args) lexenv)))
+                      (set (first args) (eval-in-lexenv (second args) lexenv))))
                  (let ((symbol (first name)))
                    (case (info :variable :kind symbol)
                      (:special)
 (defun values (&rest values)
   #!+sb-doc
   "Return all arguments, in order, as values."
+  (declare (dynamic-extent values))
   (values-list values))
 
 (defun values-list (list)