(note the space between the comma and the point)
-
143:
(reported by Jesse Bouwman 2001-10-24 through the unfortunately
prominent SourceForge web/db bug tracking system, which is
expansion, leaving garbage consisting of infinished blocks of the
partially converted function.)
-157:
- Functions SUBTYPEP, TYPEP, UPGRADED-ARRAY-ELEMENT-TYPE, and
- UPGRADED-COMPLEX-PART-TYPE should have an optional environment argument.
- (reported by Alexey Dejneka sbcl-devel 2002-04-12)
-
162:
(reported by Robert E. Brown 2002-04-16)
When a function is called with too few arguments, causing the
The similar problem exists for TRULY-THE.
+237: "Environment arguments to type functions"
+ a. Functions SUBTYPEP, TYPEP, UPGRADED-ARRAY-ELEMENT-TYPE, and
+ UPGRADED-COMPLEX-PART-TYPE now have an optional environment
+ argument, but they ignore it completely. This is almost
+ certainly not correct.
+ b. Also, the compiler's optimizers for TYPEP have not been informed
+ about the new argument; consequently, they will not transform
+ calls of the form (TYPEP 1 'INTEGER NIL), even though this is
+ just as optimizeable as (TYPEP 1 'INTEGER).
+
DEFUNCT CATEGORIES OF BUGS
IR1-#:
These labels were used for bugs related to the old IR1 interpreter.
* fixed a bug in LOG, so that LOG of a rational argument near 1 now
gives a closer approximation to the right answer than previously.
(thanks to Raymond Toy)
+ * fixed bug 157: TYPEP, SUBTYPEP, UPGRADED-ARRAY-ELEMENT-TYPE and
+ UPGRADED-COMPLEX-PART-TYPE now take (ignored, in all situations)
+ optional environment arguments, as required by ANSI.
+ * fixed bugs in other functions taking environment objects, allowing
+ calls with an explicit NIL environment argument to be compiled
+ without error.
* fixed some bugs revealed by Paul Dietz' test suite:
** ARRAY-IN-BOUNDS-P now allows arbitrary integers as arguments,
not just nonnegative fixnums;
"JUST-DUMP-IT-NORMALLY"
"KEY-INFO" "KEY-INFO-NAME"
"KEY-INFO-P" "KEY-INFO-TYPE"
- "LAYOUT-DEPTHOID"
- "LAYOUT-INVALID-ERROR" "LEXENV"
+ "LAYOUT-DEPTHOID" "LAYOUT-INVALID-ERROR"
+ "LEXENV" "LEXENV-DESIGNATOR"
"LINE-LENGTH"
"ANSI-STREAM"
"ANSI-STREAM-BIN" "ANSI-STREAM-BOUT"
(bug "called FAILED-%WITH-ARRAY-DATA with valid array parameters?"))
\f
;;;; MAKE-ARRAY
-
+(defun upgraded-array-element-type (spec &optional environment)
+ #!+sb-doc
+ "Return the element type that will actually be used to implement an array
+ with the specifier :ELEMENT-TYPE Spec."
+ (declare (ignore environment))
+ (if (unknown-type-p (specifier-type spec))
+ (error "undefined type: ~S" spec)
+ (type-specifier (array-type-specialized-element-type
+ (specifier-type `(array ,spec))))))
(eval-when (:compile-toplevel :execute)
(sb!xc:defmacro pick-vector-type (type &rest specs)
`(cond ,@(mapcar (lambda (spec)
;;; used in the ANSI spec (if this is in fact exactly the same thing)
(sb!xc:deftype streamlike () '(or stream (member nil t)))
+;;; an object suitable for input to standard functions that accept
+;;; "environment objects" (of the ANSI glossary)
+(sb!xc:deftype lexenv-designator () '(or lexenv null))
+
;;; a thing that can be passed to FUNCALL & friends
;;;
;;; FIXME: should be FUNCTION-DESIGNATOR?
:complex-arg1 :complex-subtypep-arg1))))
;;; Just parse the type specifiers and call CSUBTYPE.
-(defun sb!xc:subtypep (type1 type2)
+(defun sb!xc:subtypep (type1 type2 &optional environment)
#!+sb-doc
"Return two values indicating the relationship between type1 and type2.
If values are T and T, type1 definitely is a subtype of type2.
If values are NIL and T, type1 definitely is not a subtype of type2.
If values are NIL and NIL, it couldn't be determined."
+ (declare (ignore environment))
(csubtypep (specifier-type type1) (specifier-type type2)))
;;; If two types are definitely equivalent, return true. The second
\f
;;;; COMPLEXes
-(defun upgraded-complex-part-type (spec)
+(defun upgraded-complex-part-type (spec &optional environment)
#!+sb-doc
"Return the element type of the most specialized COMPLEX number type that
can hold parts of type SPEC."
+ (declare (ignore environment))
(cond ((unknown-type-p (specifier-type spec))
(error "undefined type: ~S" spec))
((subtypep spec 'single-float)
(class-proper-name class)))
name))))
\f
-;;; FIXME: This belongs somewhere else, perhaps in code/array.lisp.
-(defun upgraded-array-element-type (spec)
- #!+sb-doc
- "Return the element type that will actually be used to implement an array
- with the specifier :ELEMENT-TYPE Spec."
- (if (unknown-type-p (specifier-type spec))
- (error "undefined type: ~S" spec)
- (type-specifier (array-type-specialized-element-type
- (specifier-type `(array ,spec))))))
-\f
;;;; equality predicates
;;; This is real simple, 'cause the compiler takes care of it.
;;; test that the host Lisp object OBJECT translates to a target SBCL
;;; type TYPE. This behavior is needed e.g. to test for the validity
;;; of numeric subtype bounds read when cross-compiling.)
-(defun typep (object type)
+(defun typep (object type &optional environment)
#!+sb-doc
"Is OBJECT of type TYPE?"
+ (declare (ignore environment))
;; Actually interpreting types at runtime is done by %TYPEP. The
;; cost of the extra function call here should be negligible
;; compared to the cost of interpreting types. (And the compiler
;;; These can be affected by type definitions, so they're not FOLDABLE.
(defknown (upgraded-complex-part-type upgraded-array-element-type)
- (type-specifier) type-specifier
+ (type-specifier &optional lexenv-designator) type-specifier
(unsafely-flushable))
\f
;;;; from the "Predicates" chapter:
;;; FIXNUMness) might be different between host and target. Perhaps
;;; this property should be protected by #-SB-XC-HOST? Perhaps we need
;;; 3-stage bootstrapping after all? (Ugh! It's *so* slow already!)
-(defknown typep (t type-specifier) t
+(defknown typep (t type-specifier &optional lexenv-designator) t
;; Unlike SUBTYPEP or UPGRADED-ARRAY-ELEMENT-TYPE and friends, this
;; seems to be FOLDABLE. Like SUBTYPEP, it's affected by type
;; definitions, but unlike SUBTYPEP, there should be no way to make
;; (UPGRADED-ARRAY-ELEMENT-TYPE and UPGRADED-COMPLEX-PART-TYPE have
;; behavior like SUBTYPEP in this respect, not like TYPEP.)
(foldable))
-(defknown subtypep (type-specifier type-specifier) (values boolean boolean)
+(defknown subtypep (type-specifier type-specifier &optional lexenv-designator)
+ (values boolean boolean)
;; This is not FOLDABLE because its value is affected by type
;; definitions.
;;
(sb!xc:deftype name-for-class () t)
(defknown class-name (sb!xc:class) name-for-class (flushable))
-(defknown find-class (name-for-class &optional t lexenv)
+(defknown find-class (name-for-class &optional t lexenv-designator)
(or sb!xc:class null) ())
(defknown class-of (t) sb!xc:class (flushable))
(defknown layout-of (t) layout (flushable))
(defknown fmakunbound ((or symbol cons)) (or symbol cons)
(unsafe explicit-check))
(defknown (get-setf-method get-setf-method-multiple-value)
- ((or list symbol) &optional lexenv)
+ ((or list symbol) &optional lexenv-designator)
(values list list list form form)
(flushable))
(defknown apply (callable t &rest t) *) ; ### Last arg must be List...
\f
;;;; from the "Macros" chapter:
-(defknown macro-function (symbol &optional lexenv)
+(defknown macro-function (symbol &optional lexenv-designator)
(or function null)
(flushable))
-(defknown (macroexpand macroexpand-1) (t &optional lexenv)
+(defknown (macroexpand macroexpand-1) (t &optional lexenv-designator)
(values form &optional boolean))
-(defknown compiler-macro-function (t &optional lexenv)
+(defknown compiler-macro-function (t &optional lexenv-designator)
(or function null)
(flushable))
\f
;;;; from the "Eval" chapter:
(defknown eval (t) * (recursive))
-(defknown constantp (t &optional lexenv) boolean
+(defknown constantp (t &optional lexenv-designator) boolean
(foldable flushable))
\f
;;;; from the "Streams" chapter:
(describe #0a0)
(describe #(1 2 3))
(describe #2a((1 2) (3 4)))
+
+;;; TYPEP, SUBTYPEP, UPGRADED-ARRAY-ELEMENT-TYPE and
+;;; UPGRADED-COMPLEX-PART-TYPE should be able to deal with NIL as an
+;;; environment argument
+(typep 1 'fixnum nil)
+(subtypep 'fixnum 'integer nil)
+(upgraded-array-element-type '(mod 5) nil)
+(upgraded-complex-part-type '(single-float 0.0 1.0) nil)
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.12.4"
+"0.7.12.5"