I need a dictionary-like mapping between characters and other kinds of objects. Which class would be

Posted by nullPointerException on Stack Overflow See other posts from Stack Overflow or by nullPointerException
Published on 2010-06-05T04:20:11Z Indexed on 2010/06/05 6:02 UTC
Read the original article Hit count: 168

Filed under:
|
|

This is in Squeak/Pharo. If I want to have a mapping between Character objects like $a and $b to other kinds of objects, and want to look up those other objects based on the Character, what is the best class to use? Dictionary is an obvious choice, but seems wasteful to be hashing character objects which are basically already numbers. I guess what I want is a kind of array where the character value (number) is used as an index/offset, but I am not sure if this is possible with Unicode.

© Stack Overflow or respective owner

Related posts about smalltalk

Related posts about squeak