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

Tobias Pape Das.Linux at gmx.de
Wed Mar 6 15:29:27 UTC 2013


Am 06.03.2013 um 14:03 schrieb Bert Freudenberg <bert at freudenbergs.de>:

> 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?


No. I personally would use the last one :)

Best
	-tobias


More information about the Squeak-dev mailing list