[closer-devel] Closer-mop support for ABCL
Pascal Costanza
pc at p-cos.net
Sun Aug 19 15:49:10 UTC 2012
Hi Rudi,
I'm currently looking into adding support for ABCL 1.1 to the Closer project. I'm not only adding the support for Closer to MOP itself, but I'm also testing whether the other packages work (like ContextL, etc.).
I found a bug with regard to the slot layout of metaobject classes. It seems that fixed slot positions are assumed where this shouldn't be the case. Here is a transcript that illustrates the problem:
CL-USER(6): (defclass my-effective-slot-definition (standard-effective-slot-definition)
((additional-information :initarg :additional-information)))
#<STANDARD-CLASS MY-EFFECTIVE-SLOT-DEFINITION {55FD7136}>
CL-USER(7): (defclass my-class (standard-class) ())
#<STANDARD-CLASS MY-CLASS {1A78B825}>
CL-USER(8): (defmethod effective-slot-definition-class ((class my-class) &rest initargs)
(find-class 'my-effective-slot-definition))
#<STANDARD-METHOD EFFECTIVE-SLOT-DEFINITION-CLASS (MY-CLASS) {6B8192B6}>
CL-USER(9): (defclass person ()
((name :initarg :name))
(:metaclass my-class))
#<MY-CLASS PERSON {5E1F5FC7}>
CL-USER(10): (make-instance 'person :name "test")
#<THREAD "interpreter" {69996E15}>: Debugger invoked on condition of type PROGRAM-ERROR
Invalid initarg :NAME in call to MAKE-INSTANCE with arglist (#<PERSON {79B1A66B}> :NAME "test").
Restarts:
0: TOP-LEVEL Return to top level.
[1] CL-USER(11): (class-slots (find-class 'person))
(#<MY-EFFECTIVE-SLOT-DEFINITION {7E24F937}>)
[1] CL-USER(12): (inspect (first *))
0 LAYOUT -----------> #<LAYOUT {2D65CA94}>
1 ADDITIONAL-INFORMATION -> #<UNBOUND>
2 NAME -------------> NAME
3 INITFUNCTION -----> NIL
4 INITFORM ---------> NIL
5 INITARGS ---------> (:NAME)
6 READERS ----------> NIL
7 WRITERS ----------> NIL
8 ALLOCATION -------> :INSTANCE
9 ALLOCATION-CLASS -> 0
10 LOCATION ---------> NIL
11 %TYPE ------------> T
12 %DOCUMENTATION ---> NIL
Due to the additional slot that is added in my-effective-slot-definition, the ABCL MOP seems to get confused. The slot location for the 'name slot in the class 'person is stored in 'allocation-class instead of 'location. It seems that the index 9 is hard-wired for 'location in the ABCL MOP.
Can this still be fixed for ABCL 1.1?
It's probably better to add new slots in higher index positions instead of the low index positions, so the low index positions can indeed be hard-wired. But I'm not sure how easy it is to do this…
Best,
Pascal
On 13 Aug 2012, at 13:46, Rudi Schlatte <rudi at constantly.at> wrote:
> Greetings,
>
> ABCL 1.1, expected in 2-3 months from now, will have a mop implementation that passes the mop test suite without missing features. The work is finished in svn and can be checked out at http://svn.common-lisp.net/armedbear/trunk/abcl/.
>
> It would be great if we had closer-mop support by release time; attached is a naive patch (which assumes that abcl needs nothing in closer-mop-shared). I also re-send the abcl patch for mop-feature-tests. The closer-mop patch is written to give an error if :mop isn't on *features*, this feature is present in the mop-supporting svn version of abcl and will be in the released version as well, so if you decide to merge the patch, users of the old release will get a sensible error message.
>
> Cheers,
>
> Rudi
>
> <closer-mop-abcl.patch>
> <mop-feature-tests-abcl.patch>
>
> _______________________________________________
> closer-devel mailing list
> closer-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/closer-devel
--
Pascal Costanza
More information about the closer-devel
mailing list