[Pharo-project] Instantiating from a Symbol
nicolas.cellier.aka.nice at gmail.com
Mon Nov 7 15:12:03 EST 2011
2011/11/7 Nick Ager <nick.ager at gmail.com>:
>> Pharo is working towards less dependency on globals like these, so the new
>> way would be like this:
>> (self environment at: #String) new
>> (Where environment essentially does 'Smalltalk globals'),
> In my image (Pharo 1.3) #environment is defined in Behavior so I need to
> (self class environment at: #String) new
> have I missed something...
It depends where you evaluate the snippet...
Try to evaluate self in workspace, you'll get nil, but ina browser,
you'll get the selected class...
More information about the Pharo-dev