Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#61 closed defect (fixed)

Compilation of THE with DEFTYPE

Reported by: Mark Evenson Owned by: ehuelsmann
Priority: major Milestone: 0.22
Component: compiler Version: 1.0
Keywords: Cc:
Parent Tickets:

Description

As reported in http://article.gmane.org/gmane.lisp.armedbear.devel/152 by Eric Marsden, the recent work on THE forms has broken the compilation of THE forms involving macros as follows:

#|

COMPILE-FILE for this file fails with [svn r12114].

|#
(defconstant +foo-OK+ (the (integer 0 10) 5))

(deftype foo () '(integer 0 10))

(defmacro assemble-foo (x) `(the foo ,x))

(defconstant +foo+ (assemble-foo 6))

Change History (4)

comment:1 Changed 15 years ago by Mark Evenson

This has nothing to do with macros (at least not directly), but rather to the non-checking of DEFTYPEd types. This is due to use of the Java typep() which for FIXNUMs never uses the Lisp TYPEP to check things.

comment:2 Changed 15 years ago by Mark Evenson

Fix in place with r12119.

Before closing, we should consider whether to move the thunk from the Java-side typep() to the Lisp-side TYPEP up to the end of LispObject.typep(). This makes sense to me, but I would like to have second opinions.

We should also add the tests for this case.

comment:3 Changed 15 years ago by Mark Evenson

Resolution: fixed
Status: newclosed
Summary: Compilation of THE with macrosCompilation of THE with DEFTYPE

Erik fixed (and reverted r12119) with r12124 by punting on the verification of the type of a DEFTYPEd form.

He comments in (armedbear-devel)

I must say that I intentionally did not
use TYPEP because of 2 reasons:

1. It's not quite clear when it becomes available to the interpreter
   while I wanted type validation from the start

2. It will expand all types, but some Lisp types take a lot of time to verify so, I   choose the same policy as the compiler under *safety* settings lower than 3

My proposed further solution (call Lisp TYPEP at the end of the Java typep() override chain) would create a recursive dependency.

We close this ticket, by noting that ABCL's THE special operator is a bit better than before, but won't verify all types (this is allowed by the ANSI specification).

comment:4 Changed 14 years ago by ehuelsmann

Milestone: unscheduled0.22

closed is not 'unscheduled'; moving to the most recently closed milestone.

Note: See TracTickets for help on using tickets.