[cl-serializer-devel] (no subject)
Andrew Philpot
andrew_philpot at yahoo.com
Thu Aug 13 17:51:24 UTC 2009
Date: Thu, 13 Aug 2009 13:43:14 +0200
From: Pascal Costanza <pc at p-cos.net>
To: Andrew Philpot <philpot at ISI.EDU>
Subject: Re: CLOSER-MOP:SLOT-DEFINITION-ALLOCATION
On 12 Aug 2009, at 23:26, Andrew Philpot wrote:
> [also redirected to cl-serializer-devel]
[I didn't see that in the headers, so I don't know how to respond to
cl-serializer-devel.]
> CL-SERIALIZER calls CLOSER-MOP:SLOT-DEFINITION-ALLOCATION on a class
> object that might be a STANDARD-CLASS and might not (e.g. a
> STRUCTURE-CLASS). In SBCL, both of these are defined, but in Allegro
> 8.1, the only method on this generic function is on STANDARD-CLASS.
> Does it make sense to (1) extend the GF for the Allegro case in
> CLOSER-MOP to return NIL or some other sensible value (2) embed an
> appropriate check in the CL-SERIALIZER client code or (3) do you have
> another suggestion?
Thanks a lot for asking.
The CLOS MOP specification specifies methods for these accessor
functions only for the CLOS metaobject classes, but explicitly not for
structure classes (or other entities). Since Common Lisp
implementations are allowed to do whatever they want for structure
classes, I cannot ensure that whatever I want to define for structure
classes in Closer to MOP will actually be portable (now and in the
future). So I prefer not to touch structure classes.
I think the best option for you is to provide your own layer on top of
the CLOS MOP that abstracts away from these differences. So define
something like:
(defgeneric cl-serializer:slot-definition-allocation (...)
(:method (... closer-mop:standard-slot-definition ...)
(closer-mop:slot-definition-allocation ...))
(:method (... structure-slot ...) ...))
I hope this helps,
Pascal
- --
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the cl-serializer-devel
mailing list