Hi Paolo,

I am searching for a simple pattern and wonder if you or anyone else
encountered this and came up with a nice solution.

I have a SortedCollection (of objects that have a timestamp), I want to
process the timestamps until a certain date, I want to avoid extra copies.

Right now I use code like this:

copy do: [:each |
        each isTooOld ifTrue: [^true].
        each doStuff
        orig remove: each
].


Now I started to dispatch the block to another process (to avoid some locking
issues right now..) but obviously I get a BadReturn when invoking it in
another Context. Is there something like a 'break' for Iterable>>do:? is there
any other selector to help me?

One thing I can think of is something like this...

[copy isEmpty not and: [copy first isJounEnough]] whileTrue: [].

anything else?


_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to