This question came from our site for professional and enthusiast programmers.

It did. Several times. I even tried it a few times - but sadly with no success. Maybe you'll have more luck? Thanks to those who repsonded.
–
Oliver MoranApr 12 '11 at 12:25

9

@Oliver, part of asking a question here is to also show what have you done to answer that question so that people aren't trying the same things you did and get stuck. By specifying where in the Wikipedia or Google links you found you were confused this ensures your question gets better answered as at a general level the answer may not be what you wanted since it is just referencing what you didn't get previously. Just consider trying what someone else is posting and see what happens. You may be surprised at what results.
–
JB KingApr 12 '11 at 14:39

6

I sense a rap could be made out of this - "my code so lambda". But I can't rhythm it worth anything. :-)
–
Paul NathanApr 12 '11 at 15:39

1

@JB King + JB King - Thank you for your courteous comments. In broad terms, what you both say is sensible. However, depending on the query, sometimes a brief and open question is better at eliciting the kinds of replies that are not found elsewhere. My question elicited precisely the kind of answers that I was looking for. I phrased it so that it would. I hope the answers below are useful to others with the same question. It's ironic that I am satisfied with the answers at the same time that some are disappointed with the question.
–
Oliver MoranApr 12 '11 at 15:43

1

@Paul Nathan - you're code so lambda you clearly never planned ta work to any standard; it's rougher than a sander!
–
glenatronApr 12 '11 at 15:50

I'm going to tick this as my "accepted answer". It's probably not as accurate as others (which I have up voted also) but it is the answer that I'll use to remember what the phrase means.
–
Oliver MoranApr 12 '11 at 12:29

19

Only that its not quite correct. This is like to say: An integer literal is an integer value that you can pass to functions. Yet, one may also pass other interger values to functions, so it's no distinctive feature of literals. I think the shortest answer is: a lambda expression is a function literal.
–
IngoApr 12 '11 at 12:36

@Ingo: I think calling it a function literal might be the clearest simple answer I've seen to explaining lambdas in a practical sense.
–
CercerillaApr 12 '11 at 14:26

After my chat with SK-logic, I'd say now it would be more exact to say a lambda abstraction is a function literal.
–
IngoApr 12 '11 at 14:44

At least you should mention the "function" here is not the function in C, which is what most programmers would think when newly coming to this topic.
–
CodismApr 12 '11 at 15:44

Lambda expressions are either an abstraction (sometimes referred to as anonymous function), 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, though this is a common practice.

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.
–
SK-logicApr 12 '11 at 12:14

You're right, i will ammend the answer for the sake of clarity.
–
Timothy GrooteApr 12 '11 at 12:17

3

Give me an example of a lambda expression that is not a function, please.
–
IngoApr 12 '11 at 12:28

@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".
–
IngoApr 12 '11 at 14:57