"A Multi-dictionary for Pharo Smalltalk" by Alexander Brenchev on at brenchev/duntw01nrp9hkz6a00qmi16c5  0 thanks

A Multi-dictionary for Pharo Smalltalk

1. Introduction

Greetings everyone. We are moving forward to make new collections for Pharo. I decided to start with Multi-dictionary as the easiest one from the collection list, which was suggested by Stephan Ducasse.

2. The idea of Multi-dictionary

As you can understand from name of this collection, the multi-dictionary is dictionary which stores a pairs which looks like "key - array of values".

3. What we've done so far

3.1. The interface

For now, multi-dictionary have a three methods:

3.2. Examples of usage

dict := MultiDictionary new.
3.1. Creating a multi-dictionary

dict at: #a put:4.
dict at: #b put:5.
dict at: #a put:1.
3.2. Adding values to the multi-dictionary

dict add: #a->8.
dict add: #b->9.
3.3. Adding associations with add:

dict at: #a. an OrderedCollection(4,1,8)
dict at: #b. an OrderedCollection(5,9)
3.4. Getting to the list of values with at:

4. Some kind of conclusion

As you can see, right now we have a very basic prototype of multi-dictionary. Together we can make it much more better. So, now i need you help. Feel free to make a comments with your suggestions about multi-dictionary functionality. As a development procces goes, i will update this post to bring you the latest features of my collections. The latest version of multi-dictionary is available for download and experiment on my project page in a package called New Collections.

blog comments powered by Disqus