Yukihiro Matsumoto wrote:

> |This is probably the wrong place to ask, but is there resources that 
> |explain the evolution of Ruby's design in detail? It is something that I 
> |find very interesting.
> 
> I don't think so.  Google on ruby-talk may give you some information.
> Or, ask me.  I will answer you, if I could have some spare time.

Thank you. If there ever is the chance of you writing another book on 
Ruby this would be a cool thing to include, I think. I can't promise you 
that other Rubyists will be as interested in it as I am, but I hope so. :)

> Don't misunderstand me.  Blocks will remain blocks.  I just want to
> make lambdas real anonymous functions.  Current lambdas are sort of
> "faked anonymous functions" mostly due to its handling of arguments
> (and local-exit).

Why not go with  lambda(arg-list) { body }  or  fun(arg-list) { body } 
or  def(arg-list) { body }  then? I think that the syntax would point 
out that this is more than a method that turns a block into an object 
and I think that it would be a simple solution.

In action:

adder = lambda(a, b) { a + b }
adder.call(1, 2) # => 3
[1, 2, 3].inject(&adder)

generic_adder = lambda(a) do
   lambda(b) do
     a + b
   end
end

add_five = generic_adder.call(5)
add_five.call(3) # => 8
[1, 2, 3].map(&add_five) # => [6, 7, 8]

(All with function call semantics.)

It would mean that lambda() would no longer be a method call, but rather 
special syntax like defined?(), but I can live with that, especially 
since lambda wasn't the same as just doing  def lambda(&block) block end 
in the past either.

I'm not sure what lambda(&obj) should do in the future, but I think it 
is equivalent to calling obj.to_proc currently anyway.