Possible enhancement: Concise return statements

Jacob Carlborg doob at me.com
Mon Aug 15 23:58:52 PDT 2011


On 2011-08-15 22:06, Walter Bright wrote:
> On 8/15/2011 12:19 PM, Jacob Carlborg wrote:
>> Can't we always automatically return the last expression, even if it
>> ends with a
>> semicolon?
>
> It interferes with auto return typing (such as void returns).

You mean that instead of void it would return something? I'm working 
quite a lot in Ruby, which automatically returns the last expression in 
all methods and lambdas. I'm certain I'm implicitly returning a lot of 
values that I don't know about and in D these functions would be 
declared "void". I have no problem in Ruby with this, it's working great.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list