alanruttenberg at gmail.com
Wed Mar 10 23:08:03 UTC 2010
I understand the benefits and I'll consider adopting this approach.
The :allocation :class was sufficient in this case and I was curious
about what to do absent full metaclass/mop implementation.
On Wed, Mar 10, 2010 at 5:36 PM, Blake McBride <blake at mcbride.name> wrote:
> Another example is that as you create sub-classes :allocate :class
> variables don't function like regular instance variables in terms of
> inheritance. Correctly defined class variables using metaclasses do.
> 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
>>> 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
>>> 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.
More information about the armedbear-devel