[squeak-dev] How to use pool dictionaries in a workspace?

Bert Freudenberg bert at freudenbergs.de
Wed Mar 6 13:03:27 UTC 2013


On 2013-03-06, at 10:36, Tobias Pape <Das.Linux at gmx.de> wrote:

> I am curious why you want to use Pool Dictionaries in the first place.
> Not that I question them, but I have up until now never hat the necessity
> to use them, so I would be delighted to see why they are useful :)
> 
> Best
> 	-Tobias


They're pretty useful for constants you want to share across class hierarchies.

E.g. all the OpenGL constants are in a pool dict. Makes for simpler-to-read code.

Lou uses it for the Minecraft ids. Compare:

	mc blockAt: {x. y. z} put: #(35 "wool" 10 "purple)

vs

	mc blockAt: {x. y. z} put: PurpleWool

vs

	mc blockAt: {x. y. z} put: MinecraftBlock purpleWool

Any better idea?

- Bert -



More information about the Squeak-dev mailing list