[cdr-discuss] Issues with DEFTYPE

Marco Antoniotti marcoxa at cs.nyu.edu
Mon Aug 11 16:52:59 UTC 2008


Hi

I have the following DEFTYPE

(deftype int-list ()
  '(or null
       (cons integer int-list)))

Then in LW this happens

	CL-USER 6 > (typep '(1 2 3) 'int-list)

	Stack overflow (stack size 15997).

In Franz ACL the following happens instead

	CL-USER> (typep '(1 2 3) 'int-list)
	T
	CL-USER> (typep '(1 a 3) 'int-list)
	NIL

(Sorry these are the only implementations I have at hand right now).

Now: recursive types are not well understood by the CLHS, and it would  
seem that both implementations are somewhat "conforming".  However,  
since we are in 2008, ACL behavior is the "correct" one, although it  
would seem that the people at Franz are stretching the CLHS.

The question I have is the following: how do we go ahead and write a  
CDR that described ACL apparent behavior (i.e. how do we introduce  
"correct" recursive types in CL)?

Note that I just  want to start a discussion on this issue and collect  
comments and ideas.  I am interested in a medium term discussion on  
the issue; I am not interested in responses like "use Qi" or "use F#/ 
Ocaml/Haskell etc" (as an aside, Haskell is my favorite of the bunch).

Thanks

--
Marco Antoniotti

PS.  There are also issues of "compilation" vs "run-time" environments  
to be taken into account.
--
Marco Antoniotti





More information about the cdr-discuss mailing list