neal at gafter.com
Tue Jul 13 09:59:28 PDT 2010
On Jul 13, 2010, at 9:10 AM, Alessio Stalla <alessiostalla at gmail.com> wrote:
> On Tue, Jul 13, 2010 at 5:23 PM, Neal Gafter <neal at gafter.com> wrote:
>> On Tue, Jul 13, 2010 at 1:45 AM, Alessio Stalla <alessiostalla at gmail.com>
>>>> What you call "code block" would likely be used in most circumstances
>>>> without any contained control-flow
>>>> constructs. In other words, you appear to be naming distinct use cases
>>>> rather than distinct language constructs.
>>> No, because the two "use cases" give the language different semantics.
>>> With lambdas-as-functions one can copy-paste the body of a method in
>>> the body of a closure and it will "just work". With lambdas-as-blocks
>>> that doesn't hold.
>> With lambdas-as-blocks you can just copy-paste a block of code into a lambda
>> to delay its execution. With lambdas-as-method-bodies that doesn't hold.
> I agree! That's why the two are different language constructs, not
> simply different use cases for the same construct.
Indeed, that is the crux of our agreement: whether we're trying to add to Java something it already has (methods or anonymous instances) or something that enables things not possible today.
More information about the lambda-dev