* minor incompatible change: the :SB-LDB feature is now enabled by
default, and DISABLE-DEBUGGER and ENABLE-DEBUGGER also affect
the low-level debugger.
+ * bug fix: global optimization policy was not visible in LOCALLY and
+ MACROLET forms.
* bug fix: class objects can be used as specializers in methods.
(reported by Pascal Costanza)
* bug fix: native unparsing of pathnames with :DIRECTORY NIL failed
;; readtable configured so that the system sources can be read.
; :sb-show
- ;; Build SBCL with the old CMU CL low level debugger, "ldb". If are
- ;; aren't messing with SBCL at a very low level (e.g., trying to
- ;; diagnose GC problems, or trying to debug assembly code for a port
- ;; to a new CPU) you shouldn't need this.
- ; :sb-ldb
+ ;; Build SBCL with the old CMU CL low level debugger, "ldb". In the
+ ;; ideal world you would not need this unless you are messing with
+ ;; SBCL at a very low level (e.g., trying to diagnose GC problems, or
+ ;; trying to debug assembly code for a port to a new CPU). However,
+ ;; experience shows that sooner or later everyone lose()'s, in which
+ ;; case SB-LDB can at least provide an informative backtrace.
+ :sb-ldb
;; This isn't really a target Lisp feature at all, but controls
;; whether the build process produces an after-xc.core file. This
(funs vars blocks tags
type-restrictions
lambda cleanup handled-conditions
- disabled-package-locks policy)))
+ disabled-package-locks %policy)))
;; an alist of (NAME . WHAT), where WHAT is either a FUNCTIONAL (a
;; local function), a DEFINED-FUN, representing an
;; INLINE/NOTINLINE declaration, or a list (MACRO . <function>) (a
(handled-conditions *handled-conditions*)
;; lexically disabled package locks (list of symbols)
(disabled-package-locks *disabled-package-locks*)
- ;; the current OPTIMIZE policy
- (policy *policy* :type policy))
+ ;; the current OPTIMIZE policy. this is null in the null environment,
+ ;; and the global policy is stored in *POLICY*. (Because we want to
+ ;; be able to affect it from :WITH-COMPILATION-UNIT.) NIL here also
+ ;; works as a convenient null-lexenv identifier.
+ (%policy nil :type policy))
+
+(defun lexenv-policy (lexenv)
+ (or (lexenv-%policy lexenv) *policy*))
+
+(defun null-lexenv-p (lexenv)
+ (not (lexenv-%policy lexenv)))
;;; support for the idiom (in MACROEXPAND and elsewhere) that NIL is
;;; to be taken as a null lexical environment
(null (make-null-lexenv))
(lexenv x)))
-(defun null-lexenv-p (lexenv)
- (equalp (coerce-to-lexenv lexenv) (make-null-lexenv)))
-
(defun print-lexenv (lexenv stream level)
(if (null-lexenv-p lexenv)
(print-unreadable-object (lexenv stream)
--- /dev/null
+;;;; -*- lisp -*-
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; While most of SBCL is derived from the CMU CL system, the test
+;;;; files (like this one) were written from scratch after the fork
+;;;; from CMU CL.
+;;;;
+;;;; This software is in the public domain and is provided with
+;;;; absolutely no warranty. See the COPYING and CREDITS files for
+;;;; more information.
+
+(cl:in-package :cl-user)
+
+;;;; recognize self-calls
+(declaim (optimize speed))
+
+;;;; These three forms should be equivalent.
+
+;;;; This used to be a bug in the handling of null-lexenv vs toplevel
+;;;; policy: LOCALLY and MACROLET hid the toplevel policy from view.
+
+(locally
+ (defun foo (n)
+ (frob 'foo)
+ (if (<= n 0)
+ n
+ (foo (1- n)))))
+
+(progn
+ (defun bar (n)
+ (frob 'bar)
+ (if (<= n 0)
+ n
+ (bar (1- n)))))
+
+(macrolet ()
+ (defun quux (n)
+ (frob 'quux)
+ (if (<= n 0)
+ n
+ (quux (1- n)))))
+
+(defun frob (x)
+ (setf (fdefinition x) (constantly 13)))
+
+(defun test ()
+ (list (foo 1) (bar 1) (quux 1)))
+
+(assert (equal (test) '(0 0 0)))
+(assert (equal (test) '(13 13 13))) ; sanity check
+
+(write-line "//compiler-2.impure.cload.lisp")
+
;;; 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".)
-"0.9.13.35"
+"0.9.13.36"