2 ms·
Right, but you can't have multi-line anonymous functions, which are pleasant to use in Ruby and JavaScript.
by natrius 17y ago
Right, but you can't have multi-line anonymous functions, which are pleasant to use in Ruby and JavaScript.
- grandalf 17y agoTrue, but you can just write a non-anyonymous function in the current scope, which can be passed as boo or called as boo(): def test(): def boo(x): x += 2 x += 3 return x something_else(boo, 33, "hi") test() This is equivalent to how procs are often used in Ruby...