[armedbear-devel] Patch: call reinitialize-instance on metaclass on class redefinition

Alessio Stalla alessiostalla at gmail.com
Sun May 1 22:51:16 UTC 2011


On Wed, Apr 27, 2011 at 12:36 AM, Alessio Stalla
<alessiostalla at gmail.com> wrote:
> On Sat, Apr 23, 2011 at 12:53 AM, Alessio Stalla
> <alessiostalla at gmail.com> wrote:
>> Hello,
>>
>> I found out that ABCL, when redefining a class, modifies the old class
>> metaobject in-place, slot by slot. This has the implication that the
>> redefinition of an instance of a custom metaclass does not update
>> custom slots. Now, I didn't check on the AMOP, but I'm pretty sure the
>> proper class redefinition protocol is more articulate than the one
>> implemented in ABCL; still, applying the patch that you find attached
>> fixes the problem of custom slots not being updated by calling
>> reinitialize-instance where the old code manually updated the class
>> metaobject, so it is, I think, a valid temporary solution until we
>> have a full MOP. However, before committing the patch, I'd like to
>> hear your opinion about it.
>>
>> The patch also includes some tabs converted to spaces, sorry for the noise.
>
> Additionally, I also rectified the hierarchy for slot-definition and
> subclasses, introducing the classes standard-slot-definition,
> standard-direct-slot-definition and
> standard-effective-slot-definition, as specified by the AMOP (except
> for the METAOBJECT class, which is missing and should be on the CPL of
> all metaobject classes). I ran the ANSI tests and got 33 failures, one
> less than before (but that could be a randomized test passing, I
> didn't check).
> While I find it unlikely that someone has code defining custom slot
> definitions that relies on the previous class hierarchy, this is a
> potentially breaking change, so comments are welcome. If no one speaks
> up in a few days, I will commit the patch on trunk and notify the
> mailing list.

Committed as r13273 [1], with additional fixes. In the commit message
I forgot to mention the original issue about class redefinition (it's
late), but it's there. Also, while not explicitly mentioned,
user-defined classes extending slot-definition can be redefined, while
it wasn't the case before.
Let me know if you encounter any problems.

Cheers,
Alessio

[1] http://trac.common-lisp.net/armedbear/changeset/13273




More information about the armedbear-devel mailing list