[squeak-dev] The Trunk: Kernel-ar.266.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Oct 14 23:02:55 UTC 2009


Agree, the shallowCopy should simply work.

2009/10/14 Eliot Miranda <eliot.miranda at gmail.com>:
> So what semantics do people think BlockClosure>>copy should have?  I think I
> wasn't thinking when I wrote the original of the method below.  It seems to
> me that all one needs is to do shallowCopy.  Returning from a copy of a
> block seems fine. The first method return form a method wins.  e.g. [^1]
> copy value should still return.  Makes no sense for it to throw an error.
>  So the right resolution is simply to delete postCopy.
> On Tue, Oct 13, 2009 at 7:41 PM, <commits at source.squeak.org> wrote:
>>
>> Andreas Raab uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-ar.266.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-ar.266
>> Author: ar
>> Time: 13 October 2009, 7:41 am
>> UUID: f651d6ae-0be3-a54b-9166-43f4b0abaa88
>> Ancestors: Kernel-ul.264, Kernel-ul.265
>>
>> Merging Kernel-ul.264,  Kernel-ul.265:
>>
>> - removed unnecessary #fixTemps send
>> - removed Float >> #shallowCopy. Primitive 148 seems to handle this
>> correcly.
>>
>> =============== Diff against Kernel-nice.263 ===============
>>
>> Item was changed:
>>  ----- Method: BlockClosure>>postCopy (in category 'copying') -----
>>  postCopy
>>        "To render a copy safe we need to provide a new outerContext that
>>         cannot be returned from and a copy of any remoteTemp vectors.
>>         When a block is active it makes no reference to state in its
>> nested
>>         contexts (this is the whole point of the indirect temps scheme;
>> any
>>         indirect state is either copied or in indirect temp vectors.  So
>> we
>>         need to substitute a dummy outerContext and copy the copiedValues,
>>         copying anything looking like a remote temp vector.  if we
>> accidentally
>>         copy an Array that isn't actually an indirect temp vector we do
>> extra work
>>         but don't break anything."
>>
>>        outerContext := MethodContext
>>                                                sender: nil
>>                                                receiver: outerContext
>> receiver
>>                                                method: outerContext method
>> +                                               arguments: #()!
>> -                                               arguments: #().
>> -       self fixTemps!
>>
>> Item was removed:
>> - ----- Method: Float>>shallowCopy (in category 'copying') -----
>> - shallowCopy
>> -
>> -       ^self - 0.0!
>>
>>
>
>
>
>
>



More information about the Squeak-dev mailing list