* enhancement: redefinition warnings for macros from different files. (lp#434657)
* enhancement: better MACHINE-VERSION on Darwin x86 and x86-64. (lp#668332)
* enhancement: (FORMAT "foo" ...) and similar signal a compile-time warning. (lp#327223)
+ * enhancement: no more "in: LAMBDA NIL" messages from the compiler for forms
+ processed using EVAL -- now the appropriate toplevel form is reported instead.
* optimization: SLOT-VALUE &co are faster in the presence of SLOT-VALUE-USING-CLASS
and its compatriots.
* optimization: core startup time is reduced by 30% on x86-64. (lp#557357)
(setf sb!eval::*eval-level* -1
sb!eval::*eval-verbose* nil))
+(defvar *eval-source-context* nil)
+
;;; general case of EVAL (except in that it can't handle toplevel
;;; EVAL-WHEN magic properly): Delegate to #'COMPILE.
(defun %simple-eval (expr lexenv)
;; always safe. --NS
(let* (;; why PROGN? So that attempts to eval free declarations
;; signal errors rather than return NIL. -- CSR, 2007-05-01
- (lambda `(lambda ()
+ (lambda `(named-lambda (eval ,(sb!c::source-form-context *eval-source-context*)) ()
(declare (muffle-conditions compiler-note))
(progn ,expr)))
(fun (sb!c:compile-in-lexenv nil lambda lexenv)))
(not (consp (let ((sb!c:*lexenv* lexenv))
(sb!c:lexenv-find name funs)))))
(%coerce-name-to-fun name)
+ ;; FIXME: This is a bit wasteful: it would be nice to call
+ ;; COMPILE-IN-LEXENV with the lambda-form directly, but
+ ;; getting consistent source context and muffling compiler notes
+ ;; is easier this way.
(%simple-eval original-exp lexenv))))
((quote)
(unless (= n-args 1)
#!+sb-doc
"Evaluate the argument in a null lexical environment, returning the
result or results."
- (eval-in-lexenv original-exp (make-null-lexenv)))
+ (let ((*eval-source-context* original-exp))
+ (eval-in-lexenv original-exp (make-null-lexenv))))
\f
;;; miscellaneous full function definitions of things which are
`(lambda ,(second thing))
`(function ,thing)))
+(define-source-context named-lambda (name lambda-list &body forms)
+ (declare (ignore lambda-list forms))
+ (if (and (consp name) (eq 'eval (first name)))
+ (second name)
+ `(named-lambda ,name)))
+
;;; Return the first two elements of FORM if FORM is a list. Take the
;;; CAR of the second form if appropriate.
(defun source-form-context (form)
(note-message-repeats stream)
(setq last nil)
(pprint-logical-block (stream nil :per-line-prefix "; ")
- (format stream "in:~{~<~% ~4:;~{ ~S~}~>~^ =>~}" in))
+ (format stream "in:~{~<~% ~4:;~{ ~:S~}~>~^ =>~}" in))
(terpri stream))
(unless (and last
(let ((fun (eval lambda-form)))
(assert (equal lambda-form (function-lambda-expression fun))))))
+(with-test (:name (eval :source-context-in-compiler))
+ (let ((noise (with-output-to-string (*error-output*)
+ (let ((*evaluator-mode* :compile))
+ (eval `(defun source-context-test (x) y))))))
+ (with-input-from-string (s noise)
+ (assert (equal "; in: DEFUN SOURCE-CONTEXT-TEST" (read-line s))))))
+
;;; success
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.46.15"
+"1.0.46.16"