3 ms·
The fact that "lambda" came from "lambda calculus" is of such little relevance to mainstream programming today that we don't need to be reminded of it every tim
by sriku 6y ago
The fact that "lambda" came from "lambda calculus" is of such little relevance to mainstream programming today that we don't need to be reminded of it every time we want to write an "anonymous function". IMO, Clojure did the right thing there.
I'm not against the concept of lambdas (obviously, I love them since I made a scheme dialect with them for video editing). The word today is too specific for a plethora of subtly different representations/implementations of the "lambda" of "lambda calculus".
If "lambda" is supposed to mean "function", choose "function". No harm done.
- didibus 6y agoActually in Clojure I tend to distinguish: Anonymous function: (fn [a] ... a) And lambda: #(... %) I don't think this is official nomenclature, but I've been using that to distinguish between both syntaxes. In truth though, anonymous functions is the more accurate terminology, because lambdas are actually not functions, they're supposed to curry and use term substitution. Where as most programming languages use anonymous functions, which support multi-arity and sometime even variadic arity, and don't use term substitution, but more common argument binding.
- fulafel 6y agoTrivia: You can name fns: (map (fn first-or-last [x] (or (first x) (last x)) my-seq) (Of course the name has no semantic effects as you can't refer to it from code, but it's there in debugging / stack traces and serves as a comment for the reader).
- didibus 6y agoActually you can refer to the name inside the anonymous function for self-recursion I believe.