[Newbies] Enumeration type implementation

Göran Krampe goran at krampe.se
Wed Jan 4 12:04:35 UTC 2012


On 01/04/2012 01:01 PM, Göran Krampe wrote:
> I would in this case use a so called SharedPool. If you are using Squeak
> then take for example a look at GZipConstants (inherits from SharedPool,
> has classVariablesNames for each key, initialize them in class side
> initialize method) and a use of it in GZipReadStream (it just lists it
> in the class definition under poolDictionaries: and then just use those
> keys directly as if they were globals.

And another idea is to extend Number with one method for each currency 
so that you can use them just like you can use "seconds" or "minutes" today:

5 minutes

10 USD

regards, Göran


More information about the Beginners mailing list