Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.940.mcz==================== Summary ====================
Name: Collections-ul.940
Author: ul
Time: 14 April 2021, 2:16:42.453337 pm
UUID: 00bf6645-78aa-472a-a4f1-5115492fc00e
Ancestors: Collections-ul.939, Collections-ul.938
- merge
=============== Diff against Collections-ul.939 ===============
Item was added:
+ ----- Method: PositionableStream>>basicSkipTo: (in category 'accessing - multibyte support') -----
+ basicSkipTo: anObject
+
+ ^self skipTo: anObject!
Item was changed:
+ ----- Method: PositionableStream>>basicUpTo: (in category 'accessing - multibyte support') -----
- ----- Method: PositionableStream>>basicUpTo: (in category 'private basic') -----
basicUpTo: anObject
+
+ ^self upTo: anObject!
- "Answer a subcollection from the current access position to the
- occurrence (if any, but not inclusive) of anObject in the receiver. If
- anObject is not in the collection, answer the entire rest of the receiver."
- | newStream element |
- newStream := WriteStream on: (self collectionSpecies new: 100).
- [self atEnd or: [(element := self basicNext) = anObject]]
- whileFalse: [newStream nextPut: element].
- ^newStream contents!
Item was changed:
----- Method: PositionableStream>>upTo: (in category 'accessing') -----
upTo: anObject
"Answer a subcollection from the current access position to the
occurrence (if any, but not inclusive) of anObject in the receiver. If
anObject is not in the collection, answer the entire rest of the receiver."
+
+ ^self collectionSpecies streamContents: [ :stream |
+ | element |
+ [self atEnd or: [(element := self next) = anObject]]
+ whileFalse: [stream nextPut: element]]!
- | newStream element |
- newStream := WriteStream on: (self collectionSpecies new: 100).
- [self atEnd or: [(element := self next) = anObject]]
- whileFalse: [newStream nextPut: element].
- ^newStream contents!