Environment arguments to type functions

Bug #309140 reported by Nikodemus Siivola
2
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Medium
Unassigned

Bug Description

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.

Bug 310120 is one example of problems caused by not having a separate
compilation environment, and TYPEP not using the third argument.

Tags: ansi types
Changed in sbcl:
importance: Undecided → Medium
status: New → Confirmed
description: updated
description: updated
Revision history for this message
Tobias C. Rittweiler (tcr) wrote :

I think the following test case is related. If I don't get anything wrong, it should print T both times
when being compile-and-loaded.

  (eval-when (:compile-toplevel)
    (deftype bar () 'fixnum))

  (defmacro frob-with-bar (thing &environment env)
    (if (typep thing 'bar env)
        t
        nil))

  (defun quux1 ()
    (frob-with-bar 42))

  (print (quux1)) ; will print T

  (eval-when (:compile-toplevel)
    (deftype foo () 'fixnum))

  (eval-when (:load-toplevel :execute)
    (deftype foo () 'string))

  (defmacro frob-with-foo (thing &environment env)
    (if (typep thing 'foo env)
        t
        nil))

  (defun quux2 ()
    (frob-with-foo 42))

  (print (quux2)) ; will print NIL

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.