From: dblack@... Date: 2007-07-10T20:51:23+09:00 Subject: Re: Yield should be renamed call_block Hi -- On Tue, 10 Jul 2007, Robert Dober wrote: > On 7/9/07, James Edward Gray II wrote: >> On Jul 9, 2007, at 8:27 AM, John Joyce wrote: > >> > the '&' sigil is kind of scary. Reminds me of C. I'd be >> > disappointed to see Ruby get more sigils. >> >> That's nothing new for Ruby. It works today. It's also needed. > I am with you here the & makes code more readable for me. And to me, unless you absolutely need it, it's line noise. So I guess we cancel each other out :-) But I've given up on "readability" as a criterion of anything. It's too much like "intuitiveness" -- we've all got our own :-) I've always thought of the yield mechanism as one of the most strikingly elegant and expressive things in Ruby. (More subjective judgment :-) I'm actually very surprised to hear that it's likely to disappear, or change considerably. >> Without it, it wouldn't be possible to save a block into a variable >> for later use. > That is not true though > > def return_given_block > Proc.new > end > p = return_given_block { puts 42 } > p.call Interesting -- I didn't know that would happen. However, I think James's point was about using the block in a variable in the method (e.g., for calling another method using the same block). David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)