The Trunk: System-ul.613.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-ul.613.mcz

commits-2
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.613.mcz

==================== Summary ====================

Name: System-ul.613
Author: ul
Time: 2 November 2013, 1:47:09.671 pm
UUID: de29e18c-22f5-4299-823a-e6b207c3f552
Ancestors: System-cmm.612

- fix: SystemNavigation >> #allBehaviorsDo: shouldn't enumerate Trait more than once.

=============== Diff against System-cmm.612 ===============

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."
 
  self environment allClassesAndTraitsDo: [ :class |
+ aBlock value: class.
+ class isTrait ifFalse: [ "class of a Trait is Trait, there are no MetaTraits"
+ aBlock value: class class ] ]!
- aBlock
- value: class;
- value: class class ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-ul.613.mcz

Frank Shearar-3
On 2 November 2013 12:54,  <[hidden email]> wrote:

> Levente Uzonyi uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-ul.613.mcz
>
> ==================== Summary ====================
>
> Name: System-ul.613
> Author: ul
> Time: 2 November 2013, 1:47:09.671 pm
> UUID: de29e18c-22f5-4299-823a-e6b207c3f552
> Ancestors: System-cmm.612
>
> - fix: SystemNavigation >> #allBehaviorsDo: shouldn't enumerate Trait more than once.
>
> =============== Diff against System-cmm.612 ===============
>
> 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."
>
>         self environment allClassesAndTraitsDo: [ :class |
> +               aBlock value: class.
> +               class isTrait ifFalse: [ "class of a Trait is Trait, there are no MetaTraits"
> +                       aBlock value: class class ] ]!
> -               aBlock
> -                       value: class;
> -                       value: class class ]!

Thanks, Levente. I don't understand why that fixes the problem though.
Er, unless it's that when you walk over the TFoos, you also walk (and
walk and walk again) over Trait?

frank

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-ul.613.mcz

Levente Uzonyi-2
On Sat, 2 Nov 2013, Frank Shearar wrote:

> On 2 November 2013 12:54,  <[hidden email]> wrote:
>> Levente Uzonyi uploaded a new version of System to project The Trunk:
>> http://source.squeak.org/trunk/System-ul.613.mcz
>>
>> ==================== Summary ====================
>>
>> Name: System-ul.613
>> Author: ul
>> Time: 2 November 2013, 1:47:09.671 pm
>> UUID: de29e18c-22f5-4299-823a-e6b207c3f552
>> Ancestors: System-cmm.612
>>
>> - fix: SystemNavigation >> #allBehaviorsDo: shouldn't enumerate Trait more than once.
>>
>> =============== Diff against System-cmm.612 ===============
>>
>> 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."
>>
>>         self environment allClassesAndTraitsDo: [ :class |
>> +               aBlock value: class.
>> +               class isTrait ifFalse: [ "class of a Trait is Trait, there are no MetaTraits"
>> +                       aBlock value: class class ] ]!
>> -               aBlock
>> -                       value: class;
>> -                       value: class class ]!
>
> Thanks, Levente. I don't understand why that fixes the problem though.
> Er, unless it's that when you walk over the TFoos, you also walk (and
> walk and walk again) over Trait?

Yes. TFoo is a trait, if you send #class to it, it will return Trait. So
Trait was enumerated 1 + the number of traits in your image.


Levente

>
> frank
>
>