Skip to main content

Timeline for What is "lambda" code?

Current License: CC BY-SA 3.0

17 events
when toggle format what by license comment
Feb 4, 2014 at 12:41 history edited Timothy Groote CC BY-SA 3.0
fixed code
S Apr 12, 2011 at 18:27 history suggested Peter Mortensen CC BY-SA 3.0
Copy edit. Formatting (inline identifiers and a line as a subsection title).
Apr 12, 2011 at 18:26 review Suggested edits
S Apr 12, 2011 at 18:27
Apr 12, 2011 at 14:57 comment added Ingo @SK-logic I prefer to see it differently. Languages like Haskell and C# make it possible to bind functions to names in a let (rec) construct or in the form of "super-combinators" (i.e. top level function bindings), and this I see as such a grave difference that I do not feel it is right to apply the original lambda terminology here. Because no such thing is possible in LC (thats precisely why you need an Y combinator for recursion). The result of ((\x y -> x) a) and (const a) in Haskell is the same and both are applications, but I would only the first term as "lambda application".
Apr 12, 2011 at 14:45 comment added SK-logic @Ingo, the interesting part is that you can treat a subset of C# as pure lambda calculus. In this sense, C# function calls and variables are also lambda expressions.
Apr 12, 2011 at 14:39 comment added Ingo @SK-logic: I couldn't agree more. But as it stands, now the OP might say "This is lambda code." when he sees a variable in a C# program, say, because you told him, that a variable is a lambda expression. That's what I wanted to clarify. Hence: in lambda calculus, there are 3 possible expressions: lambda abstraction, application and variable.
Apr 12, 2011 at 14:09 comment added SK-logic @Ingo, it is important to understand lambda calculus prior to trying to take it into the "real" programming languages. Otherwise you'll end up thinking that it is all about "passing short anonymous functions as arguments", and will miss a whole load of useful stuff (currying, combinators, alpha- and eta- transforms, closures, free vs. bound variables, etc.)
Apr 12, 2011 at 13:33 comment added Timothy Groote Because it's easy to get lost in the scope of defining 'lambda', the initial answer i gave was an easily comprehendable one, which is commonly seen, with an example in code to clarify. I suppose it is a matter of interpreting the question. Did moran ask "what is the exact terminology of a lambda expression in the broadest sense of programming" ? Please also note this question originated from StackOverflow, which is where i started this answer.
Apr 12, 2011 at 12:58 comment added Ingo Oh well, I see. Your mileage may vary, but I find it not very helpful to take this terminlogy over to languages where not every expression is by definition a lambda expression. (And certainly, the OP did not ask for code in the lambda calculus.)
Apr 12, 2011 at 12:54 comment added SK-logic @Ingo, this is a terminology of lambda calculus, of course. en.wikipedia.org/wiki/Lambda_calculus#Lambda_terms
Apr 12, 2011 at 12:51 comment added Ingo Whence is this terminology from? You don't call 1+x a "literal expression" just because it contains a literal, do you? I am not nitpicking, just want to understand what is the reason to name it so - it would suffice to have \p.x introduced as form of an expression that we call lambda expression (or abstraction, but when we look at it from the syntactic side, expression is ok), where p is the syntactic form for naming the paramter and x is an expression.
Apr 12, 2011 at 12:42 comment added SK-logic @Ingo, what you're referring to is a lambda abstraction. But lambda expression (or lambda term) can be an abstraction, an application or a variable. E.g, \f x . f x is a function, f x is an application and x is a variable, whereas all are lambda terms.
Apr 12, 2011 at 12:28 comment added Ingo Give me an example of a lambda expression that is not a function, please.
Apr 12, 2011 at 12:20 history edited Timothy Groote CC BY-SA 3.0
added 220 characters in body
Apr 12, 2011 at 12:17 comment added Timothy Groote You're right, i will ammend the answer for the sake of clarity.
Apr 12, 2011 at 12:14 comment added SK-logic That's not quite true. Lambda expression is either an abstraction (not necessarily small), an application or a variable (most languages also add constants to this list). Lambda terms are not necessarily functions, and not necessarily passed as parameters.
Apr 12, 2011 at 12:09 history answered Timothy Groote CC BY-SA 3.0