Any reason for assigning block parameter in inject:into:

Keith Hodges keith_hodges at yahoo.co.uk
Sun Apr 29 23:18:48 UTC 2007


bryce at kampjes.demon.co.uk wrote:
> tim Rowledge writes:
>  > The difference is that both you, Bert, and Colin are quite versed in  
>  > Smalltalk. Anyone looking at Smalltalk as if it were C or some other  
>  > dismal bit-mangling nonsense might very well be seeing the method  
>  > parameter(s) as pointers.
>
> C copies the arguments and allows you to change them. Just
> like Smalltalk would if we allowed arguments to be changed.
> I think Pascal didn't allow arguments to be changed. Personally
> I'm happy with the status quo, but could live with mutable
> arguments too.
>
> Bryce
>   
Dont forget this is squeak, where at this language level no one agrees 
and nothing changes, and we are probably destined never to have 
namespaces either.

Actually on this issue the status quo has been something I have looked 
at and got annoyed with many times. Thinking - why do I have to create a 
method temporary with the same 'role suggesting instance variable name', 
when all I want to do is coerce the item into a known type, before using it.

regards

Keith



More information about the Squeak-dev mailing list