transparent lambda
Mark Mahieu
markmahieu at googlemail.com
Tue Dec 29 14:57:33 PST 2009
On 29 Dec 2009, at 22:00, Stefan Schulz wrote:
> On 29.12.2009 22:32, Mark Mahieu wrote:
>> On 29 Dec 2009, at 21:11, Neal Gafter wrote:
>>> By the way, instead of using a new keyword-ish thing, you could also
>>> use "break".
>>
>> I tried that one out on a few examples earlier today. It's a great fit
>> for void-result lambdas, but I couldn't make up my mind whether I liked
>> it quite so much when there's an actual result. It has potential, I think.
>
> break foo return bar;
>
> ;)
I think it's the terminology I'm uneasy with - for example, how do I describe clearly and unambiguously what that statement does? A return statement is easy: it "returns a value", or "returns from a method" or whatever. A hypothetical 'yield' statement is similar: "yields a value", "yields from a lambda" etc.
'break' is fine when there's no value (it "breaks from the named lambda"), but when there is one?
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.
"breaks bar from foo" maybe?
(sorry for the pedantic rambling)
More information about the closures-dev
mailing list