Hi,
the problem is that BOSS cannot store blocks since they keeps reference to a context objects from current thread.
There is no way to store blocks.
Blocks are used as comparators within the SortedCollection (
sortBlock instvar), so that's why you cannot store sorted collection.
However, SortedCollection
does not require sortBlock to be a block. It could be anything that responds to
value:value:. You may create a new class, say Comparator, then add a instance method
- Code: Select all
value: a value: b
"do whatever your sortblock do, for instance:"
^ a < b
And then create the SortedCollection with instance of Comparator as sortBlock, lke this:
- Code: Select all
things := SortedCollection sortBlock: Comparator new.
Now the collection
things contains no blocks and thus could be bossed out. Well, it's a bit more
work, but should work.