Lambda syntax for methods and functions
MattCoder
mattcoder at hotmail.com
Sat Dec 7 09:55:11 PST 2013
Sorry I forgot one thing:
On this code:
public Point Move(int dx, int dy) { return new Point(X + dx, Y +
dy); }
It would be too much trouble if the language automatically return
the last statement if this was the same type of the method? For
example:
public Point Move(int dx, int dy){
new Point(X + dx, Y + dy);
}
The return keyword wouldn't needed to be declared, because the
statement is a Point type which is the same type that method
returns.
Something like for example what happens in LISP, which returns
the last statement by default.
More information about the Digitalmars-d
mailing list