Why isn't the Ruby 1.9 lambda call possible without the dot in front of the parentheses ?
问题 I checked out the latest Ruby version, to play a bit with the latest changes. The first thing I tried to do was call a Ruby lambda/block/proc just like you'd do with a Python callable. a = lambda {|x| puts x} a.call(4) # works, and prints 4 a[4] # works and prints 4 a.(4) # same a(4) # undefined method 'a' for main:Object Why isn't the last call possible? Will it ever be? 回答1: AFAIK it's because ruby doesn't let you define the () method for an object. The reason it doesn't let you define the