[armedbear-devel] class-prototype
Blake McBride
blake at mcbride.name
Wed Mar 10 22:33:42 UTC 2010
Additionally, the :allocation :class thing is just a cheap way of
getting a semi-true class variable which is often adequate and doesn't
require all the additional machinery of a metaclass definition. It is
a convenience for restricted cases and not a true (in every respect)
class variable. The code I gave gives a true class variable in all
respects - being able to access it without an instance is just one
respect.
Blake McBride
On Wed, Mar 10, 2010 at 2:12 PM, Alessio Stalla <alessiostalla at gmail.com> wrote:
> On Wed, Mar 10, 2010 at 8:50 PM, Blake McBride <blake at mcbride.name> wrote:
>>
>> (slot-value (make-instance 'class1) 'cv2)
>>
>> creates an instance.
>
> Sure, but (slot-value (mop::class-prototype (find-class 'class1))
> 'cv2) does not and still fails with a slot-missing error, which was my
> point.
>
>> He wanted access to a true class variable,
>
> no, he wanted to "access class-allocated slot values" in his own
> words. This, in the context of CL, can only mean slots with
> :allocation :class.
>
>> stored in the class (class1) that was accessible via a class
>> reference. If that's what he wanted, that's exactly what my code
>> does.
>>
>> My example code does store cv? in class1, not the meta-class.
>
> It's perfectly fine, but cv? are not class-allocated slots, at least
> not as the CL standard defines them.
>
> Alessio
>
More information about the armedbear-devel
mailing list