Lambda vs Proc

“A lambda is just like a proc, only it cares about the number of arguments it gets and it returns to its calling method rather than returning immediately.”

Can anyone explain what this means and when to use lambdas or procs? I still don’t get it after reading articles on it. The part I don’t understand is why lambda only returns the last line. If I have a lambda that has 100 lines, my understanding is that it will only return the 100th line and ignore all previous. But why would you want to do this?

A lambda is like an iterator that cannot be terminated. A proc can be. This bears proving out, so see if this comparison has any bearing.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.