|
Re: [FIX] SortedCollectionFix-sr: msg#00788lang.smalltalk.squeak.general
I noted that SortedCollection>>reversed produces an invalid answer. Stephan Rudlof <sr@xxxxxxxxx> replied: There may be a problem: if you apply >>reversed multiple times the opposite comparison sortBlock becomes bigger and bigger, if the implementation just inverts it by constructing a new one with sending #not to the old. As you say, IF. (Although #not is DEFINITELY the wrong thing to do. We want to turn <= into >+, not into > .) There are other implementations possible, though. And indeed there are. One of them is to introduce a new class Object subclass: #BinaryBlockConverse instanceVariables: 'block' .... beConverseOf: aBlock block := aBlock converse ^aBlock value: x value: y ^block value: y value: x class>> of: aBlock ^self new beConverseOf: aBlock and a new method in BlockContext converse self assert: [self numArgs = 2]. ^BinaryBlockConverse of: self I've just sent a change set "converse-raok" that basically does this. (No, it doesn't change SortedCollection reversed.)
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: [FIX] SortedCollectionFix-sr, Richard A. O'Keefe |
|---|---|
| Next by Date: | RE: [FIX] SortedCollectionFix-sr, Richard A. O'Keefe |
| Previous by Thread: | RE: [FIX] SortedCollectionFix-sr, Richard A. O'Keefe |
| Next by Thread: | RE: [FIX] SortedCollectionFix-sr, Richard A. O'Keefe |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |