no SortedDictionary available?
Hi, I am looking for a Dictionary which sorts its entries by the keys. Some Kind of "SortedDictionary". I assume, there is none - right? I only found the OrderPreservingDictionary (which is not the same). Background: storing exchangerates by date. Sabine -- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
correction/more precise: where I can define the sort order. If I add Dates as keys in a dict, they are sorted by printstring (?). I need the dict to sort date keys by time. Sabine -- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050p4699052.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
There is currently no sorted dictionary in Pharo. There's only OrderedIdentityDictionary / OrderPreservingDictionary which are different. If you implement one or find an opensource implementation somewhere, Marcus will be pleased to integrate it in Pharo. 2013/7/17 Sabine Knöfel <sabine.knoefel@gmail.com>
correction/more precise: where I can define the sort order. If I add Dates as keys in a dict, they are sorted by printstring (?). I need the dict to sort date keys by time. Sabine
-- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050p4699052.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Tony Fleig has an OrderedDictionary in a repo of his ( http://www.squeaksource.com/TFOrderedDictionary.html), but I think it's pretty much the same as the OrderPreservingDictionary... 2013/7/17 Clément Bera <bera.clement@gmail.com>
There is currently no sorted dictionary in Pharo.
There's only OrderedIdentityDictionary / OrderPreservingDictionary which are different.
If you implement one or find an opensource implementation somewhere, Marcus will be pleased to integrate it in Pharo.
2013/7/17 Sabine Knöfel <sabine.knoefel@gmail.com>
correction/more precise: where I can define the sort order. If I add Dates as keys in a dict, they are sorted by printstring (?). I need the dict to sort date keys by time. Sabine
-- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050p4699052.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Bernat Romagosa.
Hi Clement, thank you for the fast response. I will use OrderPreservingDictionary instead. Sabine On Wed, Jul 17, 2013 at 11:32 AM, Clément Bera-4 [via Smalltalk] <ml-node+s1294792n4699062h17@n4.nabble.com> wrote:
There is currently no sorted dictionary in Pharo.
There's only OrderedIdentityDictionary / OrderPreservingDictionary which are different.
If you implement one or find an opensource implementation somewhere, Marcus will be pleased to integrate it in Pharo.
2013/7/17 Sabine Knöfel <[hidden email]>
correction/more precise: where I can define the sort order. If I add Dates as keys in a dict, they are sorted by printstring (?). I need the dict to sort date keys by time. Sabine
-- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050p4699052.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
________________________________ If you reply to this email, your message will be added to the discussion below: http://forum.world.st/no-SortedDictionary-available-tp4699050p4699062.html To unsubscribe from no SortedDictionary available?, click here. NAML
-- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050p4699068.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Have a look at: http://www.smalltalkhub.com/#!/~hernan/SortedDictionary use at your own risk, given I have no time for writing tests now. Cheers, Hernán El 17/07/2013 5:31, Sabine Knöfel escribió:
Hi,
I am looking for a Dictionary which sorts its entries by the keys. Some Kind of "SortedDictionary". I assume, there is none - right?
I only found the OrderPreservingDictionary (which is not the same).
Background: storing exchangerates by date.
Sabine
-- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
.
Hi Have you tried: http://www.squeaksource.com/BTree Used it long ago and worked well. Regards Carlo On 18 Jul 2013, at 2:10 AM, Hernán Morales Durand <hernan.morales@gmail.com> wrote: Have a look at: http://www.smalltalkhub.com/#!/~hernan/SortedDictionary use at your own risk, given I have no time for writing tests now. Cheers, Hernán El 17/07/2013 5:31, Sabine Knöfel escribió:
Hi,
I am looking for a Dictionary which sorts its entries by the keys. Some Kind of "SortedDictionary". I assume, there is none - right?
I only found the OrderPreservingDictionary (which is not the same).
Background: storing exchangerates by date.
Sabine
-- View this message in context: http://forum.world.st/no-SortedDictionary-available-tp4699050.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
.
participants (5)
-
Bernat Romagosa -
Carlo -
Clément Bera -
Hernán Morales Durand -
Sabine Knöfel