The Trunk: Traits-pre.307.mcz

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

The Trunk: Traits-pre.307.mcz

commits-2
Patrick Rein uploaded a new version of Traits to project The Trunk:
http://source.squeak.org/trunk/Traits-pre.307.mcz

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

Name: Traits-pre.307
Author: pre
Time: 20 November 2015, 2:58:26.562 pm
UUID: f0955b2d-775c-4862-85b9-5d6e616cd2e4
Ancestors: Traits-eem.306

This fixes http://bugs.squeak.org/view.php?id=7767 which is about the - and @ operator of Trait compositions ignoring brackets. This implementation uses the normal left to right evaluation order of Smalltalk to avoid confusions about the way trait composition expressions are evaluated.

=============== Diff against Traits-eem.306 ===============

Item was changed:
  ----- Method: TraitAlias>>printOn: (in category 'operations') -----
  printOn: s
  "Answer the trait composition string (used for class definitions)"
+ s nextPutAll: '('.
  s nextPutAll: subject asString.
  s nextPutAll: ' @ {'.
  aliases do:[:assoc| s print: assoc] separatedBy:[s nextPutAll:'. '].
  s nextPutAll: '}'.
+ s nextPutAll: ')'.!
- !

Item was changed:
  ----- Method: TraitComposition>>- (in category 'converting') -----
  - anArray
- "the modifier operators #@ and #- bind stronger than +.
- Thus, #@ or #- sent to a sum will only affect the most right summand"
 
+ self updateTraits: (self traitsCollect: [:aTrait | aTrait - anArray ])!
- self addLast: (self removeLast - anArray)!

Item was changed:
  ----- Method: TraitComposition>>@ (in category 'converting') -----
  @ anArrayOfAssociations
+
+ self updateTraits: (self traitsCollect: [:aTrait | aTrait @ anArrayOfAssociations ])!
- "the modifier operators #@ and #- bind stronger than +.
- Thus, #@ or #- sent to a sum will only affect the most right summand"
-
- self addLast: (self removeLast @ anArrayOfAssociations)!

Item was added:
+ ----- Method: TraitComposition>>traitsCollect: (in category 'accessing') -----
+ traitsCollect: aBlock
+ ^self collect: [:each| each traitsDo: aBlock]!

Item was changed:
  ----- Method: TraitComposition>>traitsDo: (in category 'accessing') -----
  traitsDo: aBlock
+ ^self do: [:each| each traitsDo: aBlock]!
- ^self do:[:each| each traitsDo: aBlock]!

Item was added:
+ ----- Method: TraitComposition>>updateTraits: (in category 'converting') -----
+ updateTraits: aCollection
+
+ self
+ removeAll;
+ addAll: aCollection!

Item was changed:
  ----- Method: TraitExclusion>>printOn: (in category 'composition') -----
  printOn: aStream
  "Answer the trait composition string (used for class definitions)"
+ aStream nextPutAll: '('.
  aStream nextPutAll: subject asString.
  aStream nextPutAll: ' - {'.
  exclusions asArray sort do:[:exc| aStream store: exc] separatedBy:[aStream nextPutAll: '. '].
+ aStream nextPutAll: '}'.
+ aStream nextPutAll: ')'.!
- aStream nextPutAll: '}'.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Traits-pre.307.mcz

David T. Lewis
On Fri, Jul 01, 2016 at 03:50:19PM +0000, [hidden email] wrote:

> Patrick Rein uploaded a new version of Traits to project The Trunk:
> http://source.squeak.org/trunk/Traits-pre.307.mcz
>
> ==================== Summary ====================
>
> Name: Traits-pre.307
> Author: pre
> Time: 20 November 2015, 2:58:26.562 pm
> UUID: f0955b2d-775c-4862-85b9-5d6e616cd2e4
> Ancestors: Traits-eem.306
>
> This fixes http://bugs.squeak.org/view.php?id=7767 which is about the - and @ operator of Trait compositions ignoring brackets. This implementation uses the normal left to right evaluation order of Smalltalk to avoid confusions about the way trait composition expressions are evaluated.
>

I set the issue status to "resolved" in Mantis. Thanks!

Dave