Hi,
In message "Re: new block notation (was: Re: ruby-dev summary 26468-26661)"
on Fri, 5 Aug 2005 11:44:23 +0900, Florian Gro<florgro / gmail.com> writes:
|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.
|I think that the check is not strictly necessary in blocks. I guess it
|could be argued about if it is necessary to have it for lambdas.
|
|Or can we just add the check to all blocks and lambdas? This would mean
|that multiple assignment semantics are totally gone and that [1, 2,
|3].each_with_index { |x| p x } would no longer work which might be a
|good thing, anyway.
|
|Ignoring values has been troublesome even with multiple assignment
|because of the array assignment effect anyway.
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).
|Here's another try to come up with an alternative:
|
|[1, 2, 3].inject { |a| a } # => 1
|[1, 2, 3].inject { |*a| a } # => [[1, 2], 3]
|I think both would eventually not produce warnings. The first could
|still emit a warning for a short period to get users used to the change.
Again, this issue is not related to block behavior.
matz.