[email protected] wrote:
> 
> Also I would like to know your opinion about #become: inside of  
> collections,
> (in order to grow them), while I consider this elegant, creating array  
> copy with different size
> and assigning it would be IMHO less magic.
> 
Squeak/Pharo does not use become: to grow collections, but hte second
approach you mentioned.
Not particularily because become: is too much magic, but because become: is
a slow operation in the VM they run on.

The place this makes a differences functionally, is with streams.
Consider the differences to code written:

string := String new: 5.
writeStream := string writeStream.
writeStream nextPutAll: 'aaaaaaaa'

In dialects using become, 
string will most likely be 'aaaaaaaa  ' (two 0 characters at end)

In dialects not using become, 
string will most likely be 'aaaaa', and the internal collection of the
writeStream a different object entirely.

Cheers,
Henry


--
View this message in context: 
http://forum.world.st/become-tp3489896p3490015.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to