[closer-devel] two defun's MIA

Pascal Costanza pc at p-cos.net
Wed Nov 1 00:36:47 UTC 2006


On 1 Nov 2006, at 00:58, Attila Lendvai wrote:

>
> (defmethod initialize-instance :around
>   ((class my-class) &rest initargs
>    &key direct-superclasses)
>   (declare (dynamic-extent initargs))
>   (if (loop for class in direct-superclasses
>             thereis (subtypep class (find-class 'my-object)))
>
> hm, this subtypep check errors on clisp when class is a  forward  
> referenced class.
>
> i could overcome it by (and (class-finalized-p ...)...) but that  
> doesn't feel right. (looking at the clisp backend in closer-mop i  
> couldn't find anything related).

Hm, that shouldn't be the case, but maybe I missed it. Clisp's  
support for forward-referenced-class is indeed not very good.

Try (subtypep (class-name class) 'my-object) instead. It may or may  
not work, so please let me know if it does.

>
> This idiom doesn't work in some CLOS implementations, but when you  
> use Closer to MOP, the respective problems are fixed, so you can  
> use this idiom in all implementations that Closer to MOP supports.
>
> what do you mean by "when you use Closer to MOP"? i looked around  
> in the sources but couldn't find anything related. it's not an  
> important issue, i'm fine with sbcl, but as an opensource lib it's  
> not nice to be tied to implementations.

Sure. I was pretty sure that this is forward-reference-class is  
handled properly here as well, but obviously, it's not.

There are a few possibilities to fix this, either maybe in Closer to  
MOP, or probably better by filing a bug report with clisp. I will  
look into this...

Cheers,
Pascal

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium




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


More information about the closer-devel mailing list