Calling/applying lambda vs. function call – the syntax in Ruby is different. Why?
Regular Ruby method calls use () not curly braces which are for blocks. If you don’t like [] for calling a lambda, you can always use the call method. Example: >> by_two = lambda { |x| x * 2 } #=> #<Proc:0x0000000101304588@(irb):1> >> by_two[5] #=> 10 >> by_two.call(5) #=> 10 Edit In newer version of … Read more