The Trunk: Collections-mt.688.mcz

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

The Trunk: Collections-mt.688.mcz

commits-2
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.688.mcz

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

Name: Collections-mt.688
Author: mt
Time: 13 April 2016, 10:21:42.107044 am
UUID: f8eaf0a0-9f3d-bd4d-b350-5437f277b970
Ancestors: Collections-mt.687

Remove infinite generators on streams due to lack of use cases.

=============== Diff against Collections-mt.687 ===============

Item was removed:
- ----- Method: Stream>>collectInfinitely: (in category 'enumerating - infinitely') -----
- collectInfinitely: block
-
- ^ Generator on: [:g |
- [
- g yield: (self next
- ifNil: [nil]
- ifNotNil: [:object | block value: object])
- ] repeat ]!

Item was removed:
- ----- Method: Stream>>gatherInfinitely: (in category 'enumerating - infinitely') -----
- gatherInfinitely: block
-
- ^ Generator on: [:g |
- [
- self next
- ifNil: [g yield: nil]
- ifNotNil: [:object |
- (block value: object) in: [:result | | n |
- result isStream "Simulate upToNil for infinite gathering."
- ifTrue: [ [n := result next] whileNotNil: [g yield: n] ]
- ifFalse: [result do: [:ea | g yield: ea]]]]
- ] repeat ]!

Item was removed:
- ----- Method: Stream>>rejectInfinitely: (in category 'enumerating - infinitely') -----
- rejectInfinitely: aBlock
-
- ^ self selectInfinitely: [:element | (aBlock value: element) == false]!

Item was removed:
- ----- Method: Stream>>selectInfinitely: (in category 'enumerating - infinitely') -----
- selectInfinitely: block
-
- ^ Generator on: [:g |
- [
- self next
- ifNil: [g yield: nil]
- ifNotNil: [:object |
- (block value: object)
- ifTrue: [g yield: object]]
- ] repeat ]!

Item was removed:
- ----- Method: Stream>>upToNil (in category 'accessing') -----
- upToNil
- "Answer all elements in the stream until a nil shows up."
-
- | elements next |
- elements := OrderedCollection new.
- [next := self next] whileNotNil: [
- elements add: next].
- ^ elements!