[squeak-dev] miss-used become: ???

Chris Muller asqueaker at gmail.com
Sat Jun 9 15:33:07 UTC 2012


So the whole method would seem to be useless then..

On Sat, Jun 9, 2012 at 10:17 AM, Nicolas Cellier
<nicolas.cellier.aka.nice at gmail.com> wrote:
> Try this
>
> String>>becomeB
>    self become: 'b'.
>    ^self first
>
> ^'a' becomeB
>
> Nicolas
>
> 2012/6/9 Chris Muller <asqueaker at gmail.com>:
>> Does become: swap the references in the currently executing MethodContext too?
>>
>>
>> On Fri, Jun 8, 2012 at 4:34 PM, Nicolas Cellier
>> <nicolas.cellier.aka.nice at gmail.com> wrote:
>>> UnscriptedPlayer>>assureUniClass
>>>        "Create a uniclass and become the receiver into it"
>>>
>>>        | anInstance |
>>>        anInstance := self rootClassForUniclasses instanceOfUniqueClass.
>>>        anInstance initializeCostumesFrom: self.
>>>        self become: anInstance.
>>>        ^ anInstance
>>>
>>> As I understand it, after the become: self is anInstance and anInstance is self.
>>> So this would answer the original UnscriptedPlayer before the become...
>>> Is this really the intention?
>>> Otherwise, becomeForward: would work better.
>>>
>>> Nicolas
>>>
>>
>


More information about the Squeak-dev mailing list