f(x,y) = x*x + y // Math, C, C++, Java function definition f = (x,y) -> x*x + y // Java lambda expression f = [](x,y){x*x + y;} // C++ lambda expression f = lambda x y.x*x+y // Alonzo Church lambda expression (1930) f = \x y -> x*x + y // Haskell lambda expression g() = 5 // function with no arguments g = () -> 5 // function with no arguments // This syntax could work, but we want a more modern syntax that // separates the function name from the function definition. (fun f x y (+ (* x x) y)) // too old fashion, Java, C like fun / | | \ f x y + / \ * y / \ x x // We want function definitions to be more like variable definitions. // Just two branches, the variable name and its value. (var x (* 4 5)) var / \ x * / \ 4 5 // Language_7 and Language_8 notation. (fun f (lambda x y (+ (* x x) y)) ) // very modern notation fun / \ f lambda / | \ x y + / \ * y / \ x x (fun g (lambda 5)) // function with no arguments fun / \ g lambda | 5