RE: Re: CLOS+defstruct issues
"Roger Corman" <[email protected]>
| Newsgroups | gmane.lisp.corman |
|---|---|
| Message-ID | <000001c2eac0$d448b3b0$0300a8c0@roger> |
I added two files to the patches directory: http://www.cormanlisp.com/CormanLisp/patches/2_01/ which fix this problem with :include in DEFSTRUCT. Honestly, I was never aware of this feature, so didn't implement it, although it makes perfect sense. Thanks for tracking down the problem. Roger -----Original Message----- From: news [mailto:[email protected]] On Behalf Of Frode Vatvedt Fjeld Sent: Friday, March 14, 2003 10:43 AM To: [email protected] Subject: [cormanlisp] Re: CLOS+defstruct issues Kenny Tilton <[email protected]> writes: > Here is the source of talk.lisp, into which I pasted ACL results of > each > test after they were run: > > (in-package :cl-user) > > (defstruct aaa xxx) > (defstruct (bbb (:include aaa)) yyy) > (defstruct (ccc (:include bbb)) zzz) The problem is in Corman's defstruct. The classes generated by defstruct don't get appropriate class-precedence-lists. As you can see, the classes aaa and bbb are missing: (class-precedence-list (find-class 'ccc)) => (#<Standard-Class CCC #xF30C80> #<Standard-Class STRUCTURE #x1405498> #<Standard-Class T #x146DDC8>) This means that the method dispatch won't recognize ccc objects as instances of aaa or bbb. Strangely, this still works: (typep (make-ccc) 'bbb) => t Fix defstruct, and your method dispatch will work too. -- Frode Vatvedt Fjeld To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ ------------------------ Yahoo! Groups Sponsor ---------------------~--> Get 128 Bit SSL Encryption! http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/SyjtlB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/