I don't mean lambdas in general, Lambda Calculus is obviously not broken, I was referring to implementations of it that are broken, like Python's. But I'm not asking about lambdas at all. I'm asking what differentiates a Ruby block from any other first class anonymous function.
An example would be the JavaScript function expression:
var someFunction = function (arg1, arg2) {
doStuff();
};
The function is an object that becomes referenced by someFunction. How is the capability of that object any different than a block in Ruby? To me, it seems that only the syntax differs.
I'm also not talking about Lambda Calculus, I'm talking about lambda in programming languages. "Lambda", in this sense, is an anonymous function.
Blocks are basically lambdas with flow control (your example is also a lambda that can may have flow control - I don't understand that much about JS).
And I'm also saying that a lambda without flow control is not necessarily broken. Scheme can have flow control with continuations, but this is not part of the lambda itself.
I'm really not sure why we're discussing lambdas in any detail, my original question has nothing to do with them. So far as I'm concerned, a lambda in a language should be the same as an anonymous first class function, but that has nothing to do with the difference between blocks and functions.
It's like I ask for the difference between a Moose and an Elk and you just want to discuss the nature of their hooves.
I'm trying to make my point clear. A block is just that, a lambda. But it has flow control. A normal lambda does not. This should have answered your initial question.
2
u/ryeguy146 Aug 12 '13
I don't mean lambdas in general, Lambda Calculus is obviously not broken, I was referring to implementations of it that are broken, like Python's. But I'm not asking about lambdas at all. I'm asking what differentiates a Ruby block from any other first class anonymous function.
An example would be the JavaScript function expression:
The function is an object that becomes referenced by
someFunction. How is the capability of that object any different than a block in Ruby? To me, it seems that only the syntax differs.