[Cuis-dev] Dictionary

Jonathan Kelly jonkelly at fastmail.fm
Wed Dec 30 21:23:52 CST 2015


Hi All,

I'm a relative newbie to Smalltalk, having dabbled in the past, but have 
decided to get into it proper for some projects I have in mind.

So, I've written the code for BTree as a learning  exercise and was 
thinking about the Interface and thought Dictionary would be a natural 
protocol to follow. Heavens - they think someone can understand all this 
at once?  Funny they never say how much effort that would take, or what 
your IQ would have to be.  I guess that's just me being overwhelmed.

Anyway, I discovered what I would say was a nightmare waiting to happen 
.. for someone, but it would seem not, as I'm assuming that code for 
Dictionary>>add: has been around for along time. Interested to hear more 
experienced smalltalk-er views.

| aDict assocA assocB |
aDict := Dictionary new.
assocA := 'A' -> 123.

assocA printString. "'A' -> 123"

aDict add: assocA.

assocB := 'A' -> 456.
aDict add: assocB.

assocA printString. "'A' -> 456"


Jonathan.



More information about the Cuis-dev mailing list