On Mon, Mar 31, 2008 at 3:23 AM, Leszek Dubiel <<a href="mailto:leszek@dubiel.pl">leszek@dubiel.pl</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Lambda should have the same syntax as ordinary functions. The only<br>
difference should be: you don't have to put the name of the function.<br>
<div class="Ih2E3d"><br>
def f (x, y): return x ** 2 + y ** 2<br>
<br>
</div>g = f<br>
<br>
h = def (x, y): return x ** 2 + y ** 2<br>
<br>
Functions f, g and h are doing the same.</blockquote><div><br><br>Javascript handles anonymous functions this way as well:<br><br>function f(x, y) { return x*x + y*y; }<br><br>g = f;<br><br>h = function(x, y) { return x*x + y*y; }<br>
</div></div><br>With that being said, it makes sense for the return statement to be omitted in lambdas (or anonymous defs, as I hope they will eventually be called), since those functions are limited to one statement.<br>
<br>- Eli<br><br>