Navindra Umanee <navindra / cs.mcgill.ca> wrote:
> 
> Proper OO?  Um, well how can you justify:
> 
> a = [1, 2]
> a[1]
> 
> but not:
> 
> a = lambda{|x|x*2}
> a(1)

Simple - [] is a method and () isn't :)

a[1] works nicely for lambdas too, btw (not that I wouldn't like to see
a(1), of course).

also lambda {|i| i+1}[2] #=> 3

martin