[closer-devel] Recursive types

Gary King gwking at metabang.com
Sun Jul 13 19:19:11 UTC 2008


Hi Marco,

I can't offer any trenchant comments but I am very much in favor of  
Common Lisp being able to use type declarations more "dynamically".


On Jul 1s n3, 2008, at 6:22 AM, Marco Antoniotti wrote:

> 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
>
>
>
>
> _______________________________________________
> closer-devel mailing list
> closer-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel

--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM




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


More information about the closer-devel mailing list