* ; in: DEFUN BAR
; (FOO 0)
; --> BLOCK FLET BLOCK
; ==>
; (SB-SYS:SAP-INT PTR)
;
; caught STYLE-WARNING:
; Lisp error during constant folding:
; The value 0 is not of type SYSTEM-AREA-POINTER.
(DEFUN foo1 ()
(let ((type :float))
(the (unsigned-byte) (IF (KEYWORDP TYPE) 123 TYPE))))
; in: DEFUN FOO1
; (THE (UNSIGNED-BYTE)
; (IF (KEYWORDP TYPE)
; 123
; TYPE))
;
; caught WARNING:
; Derived type of TYPE is
; (VALUES (MEMBER :FLOAT) &OPTIONAL),
; conflicting with its asserted type
; UNSIGNED-BYTE.
; See also:
; The SBCL Manual, Node "Handling of Types"
(DEFUN foo2 ()
(let ((type :float))
(let ((t2 (IF (KEYWORDP TYPE) 123 TYPE)))
(declare (unsigned-byte t2) (ignore t2)))))
; in: DEFUN FOO2
; (IF (KEYWORDP TYPE)
; 123
; TYPE)
; ==>
; TYPE
;
; caught STYLE-WARNING:
; This is not a UNSIGNED-BYTE:
; :FLOAT
; See also:
; The SBCL Manual, Node "Handling of Types"
some more possible examples with various warnings/style warnings in 1.2.6 (and 1.2.1)
(declaim (inline foo))
(sb- sys:sap- int ptr))) system- area-pointer- p pointer)
(pointer- address pointer)
(defun foo (pointer)
(flet ((pointer-address (ptr)
(declare (type system-area-pointer ptr))
(if (sb-sys:
pointer)))
(defun bar ()
(unwind-protect
(foo 0)))
* ; in: DEFUN BAR AREA-POINTER.
; (FOO 0)
; --> BLOCK FLET BLOCK
; ==>
; (SB-SYS:SAP-INT PTR)
;
; caught STYLE-WARNING:
; Lisp error during constant folding:
; The value 0 is not of type SYSTEM-
(DEFUN foo1 ()
123
TYPE)) ))
(let ((type :float))
(the (unsigned-byte) (IF (KEYWORDP TYPE)
; in: DEFUN FOO1
; (THE (UNSIGNED-BYTE)
; (IF (KEYWORDP TYPE)
; 123
; TYPE))
;
; caught WARNING:
; Derived type of TYPE is
; (VALUES (MEMBER :FLOAT) &OPTIONAL),
; conflicting with its asserted type
; UNSIGNED-BYTE.
; See also:
; The SBCL Manual, Node "Handling of Types"
(DEFUN foo2 ()
123
TYPE) ))
(let ((type :float))
(let ((t2 (IF (KEYWORDP TYPE)
(declare (unsigned-byte t2) (ignore t2)))))
; in: DEFUN FOO2
; (IF (KEYWORDP TYPE)
; 123
; TYPE)
; ==>
; TYPE
;
; caught STYLE-WARNING:
; This is not a UNSIGNED-BYTE:
; :FLOAT
; See also:
; The SBCL Manual, Node "Handling of Types"