[Seaside] [OT] Case insensitive comparison not stable ?

David Shaffer cdshaffer at acm.org
Wed Jan 11 16:25:27 CET 2006


Francois Beausoleil wrote:

>Hello everyone !
>
>I know this is off-topic, but at least recognize a few names here :)
>
>Anyway, I can't seem to sort a set of objects represented by names
>case insensitively.  Here's what I have at the moment (some methods
>omitted for brevity):
>
>Object subclass: #Author
>  instanceVariableNames: 'name email messages'
>  classVariableNames: ''
>  poolDictionaries: ''
>  category: 'Message-Board-Model'!
>
><= other
>  ^ name caseInsensitiveLessOrEqual: (other name)
>
>Set subclass: #AuthorRepository
>  instanceVariableNames: ''
>  classVariableNames: ''
>  poolDictionaries: ''
>  category: 'Message-Board-Model'!
>
>sortedByName
>  ^ SortedCollection new addAll: self.
>
>  
>
addAll: returns the argument, not the collection.  You need:

sortedByName
    ^SortedCollection new addAll: self; yourself

David



More information about the Seaside mailing list