[Seaside] [OT] Case insensitive comparison not stable ?
Francois Beausoleil
francois.beausoleil at gmail.com
Wed Jan 11 16:18:30 CET 2006
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.
If I repeatedly "Do it" the following in the Workspace, I see the
names jumping around. Also, most of the time, Stefanny is on top,
instead of Francois ?
|ar|
ar := AuthorRepository new.
ar add: (Author new name: 'francois').
ar add: (Author new name: 'stefanny').
ar add: (Author new name: 'Kelly-anne').
Transcript clear.
ar sortedByName do: [:author | Transcript show: author name; cr.]
So, what am I doing wrong here ? I'm on Squeak 3.8. Also, for the
future, where should I be asking questions like that ? Squeak-dev ?
Thanks !
--
François Beausoleil
http://blog.teksol.info/
More information about the Seaside
mailing list