Joel Bender napisał(a):
What's needed is something very concise and unobtrusive, such as
x, y => x + y
As inspired by Prolog:
x, y :- x + y
f = lambda x, y: x ** 2 + y ** 2
def f(x, y): return x ** 2 + y ** 2
f = x, y :- x ** 2 + y ** 2
And would logically transpose into this:
f(x, y) :- x ** 2 + y ** 2
Oooo...this rabbit hole is fun!
Lambda should have the same syntax as ordinary functions. The only difference should be: you don't have to put the name of the function.
def f (x, y): return x ** 2 + y ** 2
g = f
h = def (x, y): return x ** 2 + y ** 2
Functions f, g and h are doing the same.