3 ms·
Welcome to Ruby - Ruby has procs, blocks, lambdas, methods which are similar yet different. Blocks aren't objects - when they are converted to objects, they be
by irahul 15y ago
Welcome to Ruby - Ruby has procs, blocks, lambdas, methods which are similar yet different.
Blocks aren't objects - when they are converted to objects, they become procs. Procs are like blocks and lambdas are like methods, but you can't call either of them with () syntax.
And then there are multiple ways to call them:
f.call()
f[]
f.()
Take your pick.