transparent lambda
Rémi Forax
forax at univ-mlv.fr
Wed Dec 30 06:40:00 PST 2009
You can also use 'return' as a suffix and the name of the function (in a
separate scope) as prefix.
int f() {
lambda() {
f.return 42;
}.invoke();
}
Rémi
Le 30/12/2009 01:15, Mark Mahieu a écrit :
>
> On 29 Dec 2009, at 23:15, Neal Gafter wrote:
>
>> On Tue, Dec 29, 2009 at 2:57 PM, Mark Mahieu
>> <markmahieu at googlemail.com <mailto:markmahieu at googlemail.com>> wrote:
>>
>> Your example suggests that I should say something like "breaks
>> from the lambda named 'foo' returning 'bar'", but if its
>> producing a result from the lambda then "return" is exactly the
>> word I'd like to avoid here.
>>
>>
>> I would use the word "result":
>>
>> The statement
>>
>> *break* /Identifier* */*: */Expression// /*;*
>>
>> terminates execution of the body of the lambda with whose label is
>> given by the identifier, with the result value given by the expression.
>>
>> -Neal
>
> Yes, "result" is a superior choice.
>
> However, it's the informal, succinct, conversational description of
> what the statement does that I'm trying to pin down - the verb,
> perhaps - which ideally should be suggested by the statement itself.
> That's why 'yield' is tempting; it's the verb you use in the spec.
>
> In conversations about BGGA, it was often tricky to tell whether
> someone was talking about a local or nonlocal return because both
> would often be informally described as 'returning'.
>
> Maybe I'm looking at this the wrong way though, and it's not so much
> the *kind* of return/yield that should be emphasised, but *where* it
> is returning/yielding from. Which is certainly what this labelling
> idea suggests.
>
> Mark
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091230/950dcc42/attachment-0001.html
More information about the closures-dev
mailing list