[Newbies] Best way to implement two-dimensional array
blake at kingdomrpg.com
Sun Sep 2 22:45:55 UTC 2007
You know, I've asked this a number of times and there's a neglected 2D
array class, but I've found you don't really need it. You can just use a
aDict at:x at y put:anObject
anObject := aDict at:x at y
It sort of rubs me the wrong way but it's workable.
On Sun, 02 Sep 2007 05:45:42 -0700, John Almberg <jalmberg at identry.com>
> This is a smalltalk question, but hopefully not too off-topic...
> I need a lookup table object... something to which I can send a message
> anElement := myTable index1: #aSymbol index2: #anotherSymbol
> The underlying structure is actually a table... rows and columns... and
> I want to be able to fetch elements in the table.
> I am thinking myTable should hold a dictionary of dictionaries, (a hash
> of hashes, I might say if using another language), but I am wondering if
> there is a more smalltalk-ish way to do this?
> Any suggestions much appreciated.
> -- John
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners