From: William Harold Newman Date: Mon, 20 Nov 2000 02:10:29 +0000 (+0000) Subject: 0.6.8.22: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=f1bd97fb5f536b9ac7195aaa20bf02c829793f6a;p=sbcl.git 0.6.8.22: gave up fixing bug 3, documented workaround instead:-| fixed bug 4: no WARNING for DECLAIM FTYPE for slot accessor fun --- diff --git a/BUGS b/BUGS index a277e01..ea7f729 100644 --- a/BUGS +++ b/BUGS @@ -43,11 +43,38 @@ KNOWN BUGS OF NO SPECIAL CLASS: SBCL to wager that this (undefined in ANSI) operation would be safe. 3: - It should cause a STYLE-WARNING, not a full WARNING, when a structure - slot default value does not match the declared structure slot type. - (The current behavior is consistent with SBCL's behavior elsewhere, - and would not be a problem, except that the other behavior is - specifically required by the ANSI spec.) + ANSI specifies that a type mismatch in a structure slot + initialization value should not cause a warning. +WORKAROUND: + This one might not be fixed for a while because while we're big + believers in ANSI compatibility and all, (1) there's no obvious + simple way to do it (short of disabling all warnings for type + mismatches everywhere), and (2) there's a good portable + workaround. ANSI justifies this specification by saying + The restriction against issuing a warning for type mismatches + between a slot-initform and the corresponding slot's :TYPE + option is necessary because a slot-initform must be specified + in order to specify slot options; in some cases, no suitable + default may exist. + In SBCL, as in CMU CL (or, for that matter, any compiler which + really understands Common Lisp types) a suitable default does + exist, in all cases, because the compiler understands the concept + of functions which never return (i.e. has return type NIL, e.g. + ERROR). Thus, as a portable workaround, you can use a call to + some known-never-to-return function as the default. E.g. + (DEFSTRUCT FOO + (BAR (ERROR "missing :BAR argument") + :TYPE SOME-TYPE-TOO-HAIRY-TO-CONSTRUCT-AN-INSTANCE-OF)) + or + (DECLAIM (FTYPE () NIL) MISSING-ARG) + (DEFUN REQUIRED-ARG () ; workaround for SBCL non-ANSI slot init typing + (ERROR "missing required argument")) + (DEFSTRUCT FOO + (BAR (REQUIRED-ARG) :TYPE TRICKY-TYPE-OF-SOME-SORT) + (BLETCH (REQUIRED-ARG) :TYPE TRICKY-TYPE-OF-SOME-SORT) + (N-REFS-SO-FAR 0 :TYPE (INTEGER 0))) + Such code will compile without complaint and work correctly either + on SBCL or on a completely compliant Common Lisp system. 4: It should cause a note, not a WARNING, when the system ignores diff --git a/NEWS b/NEWS index 6e371e9..61cb8b2 100644 --- a/NEWS +++ b/NEWS @@ -568,8 +568,6 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: ** The TOP debugger command is also gone, since it's redundant with the FRAME 0 command, and since it interfered with abbreviations for the TOPLEVEL restart. -* removed bug 21 from BUGS, since Martin Atzmueller points out that - it doesn't seem to affect SBCL after all * The system now recovers better from non-PACKAGE values of the *PACKAGE* variable. * The system now understands compound CONS types (e.g. (CONS FIXNUM T)) @@ -598,6 +596,11 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: files, thanks to a patch originally from Douglas Crosher. * Martin Atzmueller also fixed ROOM, so that it no longer fails with an undefined function error. +* gave up on fixing bug 3 (forbidden-by-ANSI warning for type mismatch + in structure slot initforms) for now, wrote workaround instead:-| +* fixed bug 4 (no WARNING for DECLAIM FTYPE of slot accessor function) +* removed bug 21 from BUGS, since Martin Atzmueller points out that + it doesn't seem to affect SBCL after all planned incompatible changes in 0.7.x: * The debugger prompt sequence now goes "5]", "5[2]", "5[3]", etc. diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 5d63a32..7019837 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -206,7 +206,8 @@ "MAKE-OTHER-IMMEDIATE-TYPE" "MAKE-RANDOM-TN" "MAKE-REPRESENTATION-TN" "MAKE-RESTRICTED-TN" "MAKE-SC-OFFSET" "MAKE-STACK-POINTER-TN" "MAKE-TN-REF" "MAKE-UNWIND-BLOCK" - "MAKE-VALUE-CELL" "MAKE-WIRED-TN" "META-PRIMITIVE-TYPE-OR-LOSE" + "MAKE-VALUE-CELL" "MAKE-WIRED-TN" "MAYBE-COMPILER-NOTE" + "META-PRIMITIVE-TYPE-OR-LOSE" "META-SB-OR-LOSE" "META-SC-NUMBER-OR-LOSE" "META-SC-OR-LOSE" "MORE-ARG-CONTEXT" "MOVABLE" "MOVE" "MULTIPLE-CALL" "MULTIPLE-CALL-LOCAL" "MULTIPLE-CALL-NAMED" diff --git a/src/compiler/ir1util.lisp b/src/compiler/ir1util.lisp index c846a07..73eb6ee 100644 --- a/src/compiler/ir1util.lisp +++ b/src/compiler/ir1util.lisp @@ -1644,6 +1644,18 @@ format-args)) (values)) +;;; Issue a note when we might or might not be in the compiler. +(defun maybe-compiler-note (&rest rest) + (if (boundp '*lexenv*) ; if we're in the compiler + (apply #'compiler-note rest) + (let ((stream *error-output*)) + (pprint-logical-block (stream nil :per-line-prefix ";") + + (format stream " note: ~3I~_") + (pprint-logical-block (stream nil) + (apply #'format stream rest))) + (fresh-line stream)))) ; (outside logical block, no per-line-prefix) + ;;; The politically correct way to print out progress messages and ;;; such like. We clear the current error context so that we know that ;;; it needs to be reprinted, and we also Force-Output so that the diff --git a/src/compiler/proclaim.lisp b/src/compiler/proclaim.lisp index 7dcfa27..6232e72 100644 --- a/src/compiler/proclaim.lisp +++ b/src/compiler/proclaim.lisp @@ -167,8 +167,24 @@ (error "not a function type: ~S" (first args))) (dolist (name (rest args)) (cond ((info :function :accessor-for name) - (warn "ignoring FTYPE proclamation for slot accessor:~% ~S" - name)) + ;; FIXME: This used to be a WARNING, which was + ;; clearly wrong, since it would cause warnings to + ;; be issued for conforming code, which is really + ;; annoying for people who use Lisp code to build + ;; Lisp systems (and check the return values from + ;; COMPILE and COMPILE-FILE). Changing it to a + ;; compiler note is somewhat better, since it's + ;; after all news about a limitation of the + ;; compiler, not a problem in the code. But even + ;; better would be to handle FTYPE proclamations + ;; for slot accessors, and since in the long run + ;; slot accessors should become more like other + ;; functions, this should eventually become + ;; straightforward. + (maybe-compiler-note + "~@" + name)) (t ;; KLUDGE: Something like the commented-out TYPE/= diff --git a/version.lisp-expr b/version.lisp-expr index 27db04e..ae852fa 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string like "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.8.21" +"0.6.8.22"