From: Gavin Kistner Date: 2005-08-05T22:25:28+09:00 Subject: Re: new block notation (was: Re: ruby-dev summary 26468-26661) --Apple-Mail-4-1059709707 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Aug 4, 2005, at 11:58 PM, Yukihiro Matsumoto wrote: > 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). Matz, I see that you plan on keeping the syntax and mechanics of blocks separate from lambdas. I assume this means that internally there will be a Block class separate from a Lambda (or other-named) class. From this thread I think I understand why: * need really terse syntax for blocks * sometimes you want arity matching, sometimes you don't But it still makes me sad that we will (at least) have Blocks different from Methods, despite the fact that both are code chunks that take arguments. Will lambdas be interchangeable with methods? Or do you envision the future of Ruby as still having at least three distinct functional items: * Blocks * Lambdas (whatever the syntax) * Methods (And by distinct, I mean more than just different syntax for defining them; that internally they will be different, non-interchangeable objects.) If the answer is "yes, there will still be three distinct chunk-of- code-with-parameters items", I request that there at least be methods for transforming between all three: my_array.each( &MyClass.instance_method( :foo ) ) f = lambda{ ... } my_array.each( &f ) etc. --Apple-Mail-4-1059709707--