DEV Community

loading...

Discussion on: Comparing function handles across languages

Collapse
shalvah profile image
Shalvah Author • Edited

lambdas == procs

Thank you. Just looked it up and noticed that the docs actually list lambdas as a proc flavour. Frankly, I'm not sure if that makes it better or worse.🤣

I also think the new ->(x, y) { x * y } syntax is cooler than the old lambda keyword.

Hehe, it's the syntax I see in most places too, but I prefer lambda, as it's clearer. Same thing for the .() (and all the different ways you can call in Ruby—I favour .call().😄 But I did not know that it worked in the reverse too (replacing a user-defined .call() method. Interesting.