[squeak-dev] The Inbox: System-jr.948.mcz

Jakob Reschke jakob.reschke at student.hpi.de
Tue May 16 22:09:28 UTC 2017


Hi,

I almost expected this feedback regarding allInstances ;-) If the change is
still only in the Inbox, no harm should have been done, otherwise somebody
else should revert it in trunk.

An alternative would be to enumerate only the Environments registered in
that class pool variable. It requires everyone to use the correct
"constructor" though, when the Environment is set up.

For the sake of learning some more: I have plenty of garbage environments
in my image (due to test cases creating them and references I will have to
track down at another time), but the allInstancesDo does not remarkably
slow down the navigation features for me. Which cases do you have in mind
when you say that it does not scale?

Best,
Jakob

Am 16.05.2017 23:21 schrieb "Eliot Miranda" <eliot.miranda at gmail.com>:

> Hi Jakob,
>
>
>
> On Tue, May 16, 2017 at 10:09 AM, <commits at source.squeak.org> wrote:
>
>> A new version of System was added to project The Inbox:
>> http://source.squeak.org/inbox/System-jr.948.mcz
>>
>> ==================== Summary ====================
>>
>> Name: System-jr.948
>> Author: jr
>> Time: 5 May 2017, 12:08:58.857884 am
>> UUID: 4a19b143-6a23-b549-ab15-0d548da859f4
>> Ancestors: System-ul.947
>>
>> incorporate behaviors from other environments in allBehaviorsDo:
>>
>> This enables senders/implementors and method searches across environments.
>>
>> =============== Diff against System-ul.947 ===============
>>
>> Item was changed:
>>   ----- Method: SystemNavigation>>allBehaviorsDo: (in category 'query')
>> -----
>>   allBehaviorsDo: aBlock
>>         "Evaluate the argument, aBlock, for each kind of Behavior in the
>> system
>>         (that is, Object and its subclasses and Traits).
>>         ar 7/15/1999: The code below will not enumerate any obsolete or
>> anonymous
>>         behaviors for which the following should be executed:
>>
>>                 Smalltalk allObjectsDo:[:obj| obj isBehavior
>> ifTrue:[aBlock value: obj]].
>>
>>         but what follows is way faster than enumerating all objects."
>>
>> +       Environment allInstancesDo: [:environment |
>> +               environment allClassesAndTraitsDo: [ :class |
>> +                       aBlock value: class.
>> +                       class isTrait ifFalse: [ "class of a Trait is
>> Trait, there are no MetaTraits"
>> +                               aBlock value: class class ] ] ]!
>> -       self environment allClassesAndTraitsDo: [ :class |
>> -               aBlock value: class.
>> -               class isTrait ifFalse: [ "class of a Trait is Trait,
>> there are no MetaTraits"
>> -                       aBlock value: class class ] ]!
>>
>
> Forgive me for being blunt but Environment allInstancesDo: is absurd and
> unacceptable.  Environments *must* build some kind of graph that can be
> enumerated without recourse to a hammer like allInstancesDo:.  This simply
> doesn't scale.  And it suffers the problem of enumerating environments that
> are no longer in use but have yet to be garbage collected.  Please roll
> back this change and take a better approach.
>
> _,,,^..^,,,_
> best, Eliot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170517/7cd37f50/attachment.html>


More information about the Squeak-dev mailing list