[closer-devel] Recursive types

Marco Antoniotti marcoxa at cs.nyu.edu
Sun Jul 13 10:22:03 UTC 2008


Hi

I am writing here because this may be the place closest to some of the  
issue I would like to raise (slowly!) with some of the typing issues  
in CL.

Consider the following (contrived) example

(defstruct node
   content
   (left nil :type (or null arc))
   (right nil :type (or null arc)))


(defstruct arc
   (source nil :type (or null node))
   (sink nil :type (or null node)))

At least on LW, compiling the snippet the first time raises the  
following warning

; (SUBFUNCTION MAKE-NODE (DEFSTRUCT NODE))
;;;*** Warning in (SUBFUNCTION MAKE-NODE (STRUCTURE NODE)): Ignoring  
type declaration with illegal type (OR NULL ARC)
;;;*** Warning in (SUBFUNCTION MAKE-NODE (STRUCTURE NODE)): Ignoring  
type declaration with illegal type (OR NULL ARC)

There seem to be no way in CL to make a "forward" type declaration.   
So, the questions I raise are two.
1 - which would be the best forum (:if-exists :use-it :if-does-not- 
exist :do-not-use-c.l.l.-yet) where to have this discussion?
2 - where would you look in the ANSI spec for places where various  
clauses needs to be changed or removed to make recursive types "CDR- 
able"?

Cheers
--
Marco




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/closer-devel/attachments/20080713/f1192593/attachment.html>


More information about the closer-devel mailing list