X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffull-eval.lisp;h=6f6a88f6adce45fe1746783d47207419115a006f;hb=007bcd5aac2f3a1e714563bd39f7a2db2d0bf7c2;hp=56208a054bdb9997c45e532ced98c9879b2dac1c;hpb=970dd272dc84f7420252eadb4829cc193f795716;p=sbcl.git diff --git a/src/code/full-eval.lisp b/src/code/full-eval.lisp index 56208a0..6f6a88f 100644 --- a/src/code/full-eval.lisp +++ b/src/code/full-eval.lisp @@ -185,13 +185,13 @@ ;;; Augment ENV with a local function binding (declaim (inline push-fun)) -(defun push-fun (name value env) +(defun push-fun (name value calling-env body-env) (when (fboundp name) - (let ((sb!c:*lexenv* (env-native-lexenv env))) + (let ((sb!c:*lexenv* (env-native-lexenv calling-env))) (program-assert-symbol-home-package-unlocked :eval name "binding ~A as a local function"))) - (push (cons name value) (env-funs env)) - (push (cons name :bogus) (sb!c::lexenv-funs (env-native-lexenv env)))) + (push (cons name value) (env-funs body-env)) + (push (cons name :bogus) (sb!c::lexenv-funs (env-native-lexenv body-env)))) (sb!int:def!method print-object ((env env) stream) (print-unreadable-object (env stream :type t :identity t))) @@ -279,7 +279,8 @@ (defun parse-arguments (arguments lambda-list) (multiple-value-bind (required optional rest-p rest keyword-p keyword allow-other-keys-p aux-p aux) - (sb!int:parse-lambda-list lambda-list) + (handler-bind ((style-warning #'muffle-warning)) + (sb!int:parse-lambda-list lambda-list)) (let* ((original-arguments arguments) (arguments-present (length arguments)) (required-length (length required)) @@ -681,6 +682,8 @@ (push-fun (car function-def) ;; Evaluate the function definitions in ENV. (eval-local-function-def function-def env) + ;; Do package-lock checks in ENV. + env ;; But add the bindings to the child environment. new-env)) (eval-progn body new-env))))) @@ -697,6 +700,7 @@ (dolist (function-def local-functions) (push-fun (car function-def) (eval-local-function-def function-def env) + old-env env)) ;; And then add an environment for the body of the LABELS. A ;; separate environment from the one where we added the @@ -893,7 +897,8 @@ (do ((form body (cdr form))) ((null form) nil) (when (atom (car form)) - ;; FIXME: detect duplicate tags + (when (assoc (car form) tags) + (ip-error "The tag :A appears more than once in a tagbody.")) (push (cons (car form) (cdr form)) tags) (push (cons (car form) #'go-to-tag) (env-tags env))))) ;; And then evaluate the forms in the body, starting from the @@ -1199,11 +1204,6 @@ (%eval form env)) (compiler-environment-too-complex-error (condition) (declare (ignore condition)) - ;; FIXME: this could be a really annoying warning. It should - ;; have its own class. - (sb!int:style-warn - "~@" - form lexenv) + (sb!int:style-warn 'sb!kernel:lexical-environment-too-complex + :form form :lexenv lexenv) (sb!int:simple-eval-in-lexenv form lexenv)))))