Dictionary initialization syntax

Mark Greenaway mark at knobbits.org
Thu Dec 7 05:20:12 UTC 2000


I'm fairly new to Smalltalk and have been learning mostly by looking at
web pages and bits of Squeak code. I was wondering if there was a way to
initialise dictionaries in the same way you can in Python i.e.

dict = {1 : 2, 3 : 4}

I was hoping something like {1->2. 3->4} asDictionary might work, but
asDictionary converts the keys to strings using printString. Should I just
change asDictionary or is there a better way?

Mark





More information about the Squeak-dev mailing list