no SortedDictionary available?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

no SortedDictionary available?

Sabine Manaa
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

Reply | Threaded
Open this post in threaded view
|

Re: no SortedDictionary available?

Sabine Manaa
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
Reply | Threaded
Open this post in threaded view
|

Re: no SortedDictionary available?

Clément Béra
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.


Reply | Threaded
Open this post in threaded view
|

Re: no SortedDictionary available?

Bernat Romagosa
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 <[hidden email]>
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.





--
Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: no SortedDictionary available?

Sabine Manaa
In reply to this post by Clément Béra
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]
<[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: no SortedDictionary available?

hernanmd
In reply to this post by Sabine Manaa
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.
>
> .
>


Reply | Threaded
Open this post in threaded view
|

Re: no SortedDictionary available?

Carlo-2
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 <[hidden email]> 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.
>
> .
>