jastrachan | 1 Feb 17:13 2005
Picon

Re: thoughts on the closure/return/break/continue issue

On 1 Feb 2005, at 16:05, Guillaume Laforge wrote:
> On Tue, 1 Feb 2005 15:55:04 +0000, jastrachan@...
> <jastrachan@...> wrote:
>> One other thought on this proposal.
>>
>> The syntax rules for return statements in methods/functions seems 
>> quite
>> different to those in closures, which feels a little smelly. Maybe 
>> they
>> should have the same shape/feel?
>>
>> So how about this minor change...
>>
>> [...]
>>
>> Thoughts?
>
> So to sum up the proposition, that minor change is just about
> requiring a mandatory "return" in both methods and closures. No more
> optional "return" for multi-statements methods or closures. Right ?
>
> If so, yes, I think it's even clearer, and the rule is much simpler to 
> remember.

Yes. So apart from single expression methods/closures, we have to use a 
return/continue to return a value from any block (whether its a 
method/function/closure)

James
-------
http://radio.weblogs.com/0112098/


Gmane