Any reason for assigning block parameter in inject:into:
Vassili Bykov
smalltalkbigot at gmail.com
Mon Apr 30 00:03:43 UTC 2007
I find if completely natural to expect to be able to assign to
arguments, and for reasons entirely unrelated to Javascript. An
argument is a binding in the environment created for evaluating the
body of a lambda expression when it is applied, and as such there is
no fundamental difference between it an a temporary variable. I see
| a |
a := 3.
a := a + 4
and
[:a | a := a + 4] value: 3
as the same thing. In this light, I see the "classic" policy of
disallowing the latter as an arbitrary restriction, even when
supported by emphatic hand-waving.
Oh, and the VisualWorks compiler has a configuration option to allow
assignments to arguments.
--Vassili
More information about the Squeak-dev
mailing list
|