[squeak-dev] The Trunk: Collections-eem.1023.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Nov 23 10:45:41 UTC 2022


To be more clear: Please tweak this change ASAP before strange code gets written where #subStrings: is sent to collections other than String ... I opt for #subCollections: ... in String, that can forward from #subStrings:.

Best,
Marcel
Am 23.11.2022 11:27:16 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Ehm ... please offer something like #subCollections:. Having #subStrings: on SequenceableCollection is a nasty misuse of domain vocabulary... Only String should offer #subStrings:. Other code should write subCollections: instead.

Best,
Marcel
Am 23.11.2022 04:50:37 schrieb Eliot Miranda <eliot.miranda at gmail.com>:
On Tue, Nov 22, 2022 at 7:13 PM <commits at source.squeak.org [mailto:commits at source.squeak.org]> wrote:

Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.1023.mcz [http://source.squeak.org/trunk/Collections-eem.1023.mcz]

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

Name: Collections-eem.1023
Author: eem
Time: 22 November 2022, 7:12:52.434373 pm
UUID: 9c7f84f0-35b9-476f-9d51-75cc12248c26
Ancestors: Collections-eem.1022

Reimplement subStrings: in SequenceableCollection (this is where it belongs; subStrings: on arbitrary sequeances is useful).  Allow the argument to be a singleton, if not a collection.  Reimplement to use an index and copyFrom:to: instead of consing up a string on each element.


Hence

(1 to: 100) subStrings: (10 to: 90 by: 10) {(1 to: 9) . (11 to: 19) . (21 to: 29) . (31 to: 39) . (41 to: 49) . (51 to: 59) . (61 to: 69) . (71 to: 79) . (81 to: 89) . (91 to: 100)}

Smalltalk is beautiful.
_,,,^..^,,,_

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20221123/66cc9cba/attachment.html>


More information about the Squeak-dev mailing list