add_role and remove_role on a Class PMC

Jonathan Worthington jonathan at jnthn.net
Mon Feb 21 16:15:50 UTC 2011


On 21/02/2011 08:18, Jonathan "Duke" Leto wrote:
> It recently came to my attention, while writing tests for
> extend_vtable.c, that one can add a role to a class, but not remove
> it.
>
> Specifically, the Class PMC has the add_role VTABLE but not the
> remove_role VTABLE.
>
> This seems broken to me.
>
Removing a role doesn't really make much sense to me. Composition is 
flattening, which means that you'd probably have to re-compose 
everything and - worse - keep around extra information to allow you to 
do so once a role was removed. So I'm not surprised nobody ever 
implemented role removal - it's probably a semantic can of worms. Of 
course, hindsight is 20/20. :-)

/jnthn




More information about the parrot-dev mailing list