Wednesday, February 03, 2010

SuperPower oneWayBecome: SuperResponsibility

So let's say you like super powers, right? Execute the following code.

    a := ClassA new.
    ClassA oneWayBecome: ClassB

What should be the response to the following expression?

    a class

Really? Why? :)...

2 comments:

nicolas cellier said...

I would say the power is in our hands.
We have to mutate the class with all its instances in a single atomic operation.
That's the single thing the system should be responsible for: providing such an atomic facility.

Andrés said...

Ok, so how do you plan to mutate instances of an arbitrary class into instances of another arbitrary class? And how will the VM recognize a class when it sees it?