[closer-devel] two defun's MIA
Pascal Costanza
pc at p-cos.net
Wed Nov 1 13:31:18 UTC 2006
OK, I have done a few quick checks in the various CLOS
implementations, and clisp, ecl, MCL and LispWorks have problems with
one way or the other.
Here is a dirty workaround that should work on all systems, though:
(loop for class in direct-superclasses
thereis (ignore-errors (subtypep class (find-class 'my-object))))
This should get your code working.
I will add more detailed checks on forward-referenced-class to the
MOP Feature Tests and then proceed by either submitting bug reports
and/or trying to fix things in Closer to MOP. This will take a while,
though.
Cheers,
Pascal
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).
>
> 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.
>
> --
> - attila
>
> "- The truth is that I've been too considerate, and so became
> unintentionally cruel...
> - I understand.
> - No, you don't understand! We don't speak the same language!"
> (Ingmar Bergman - Smultronstället)
--
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/975daf0f/attachment.html>
More information about the closer-devel
mailing list