Any reason for assigning block parameter in inject:into:

Lukas Renggli renggli at gmail.com
Sat Apr 28 08:37:02 UTC 2007


> asPacked
>         ^ self
>                 inject: 0
>                 into: [:t1 :t2 | t1 := t1 * 256 + t2 asInteger]
>
> The assignment is not needed since the semantics of into: is to do
> that exactly

Odd that the compiler allows you to do that. In VW this code raises a
compiler error, as it does in Squeak when you try to store into a
method argument. I hope the new compiler is a bit more consistent.

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list