[squeak-dev] The Inbox: Collections-ct.1022.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Oct 21 12:24:07 UTC 2022
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.1022.mcz
==================== Summary ====================
Name: Collections-ct.1022
Author: ct
Time: 21 October 2022, 2:24:04.563911 pm
UUID: 6c7815e3-3bf9-be4b-a8cb-ae2373cb6658
Ancestors: Collections-nice.1021
Proposal: Adds PositionableStream>>#peek:. The implementation is taken from Damien Cassou (dc). [1]
[1] https://github.com/hpi-swa/Squot/blob/4bf8e3b685ef9cbc195b7eca77d53a482833bf22/src/FileSystem-Git.package/PositionableStream.extension/instance/peek..st
=============== Diff against Collections-nice.1021 ===============
Item was added:
+ ----- Method: PositionableStream>>peek: (in category 'accessing') -----
+ peek: anInteger
+ "Answer what would be returned if the message next: anInteger were sent to the receiver. If the receiver has less than anInteger more elements, only answer so many elements as available."
+
+ | oldPosition result |
+ oldPosition := position.
+ result := self next: anInteger.
+ position := oldPosition.
+ ^ result!
More information about the Squeak-dev
mailing list
|