Hi --

On Mon, 6 Aug 2007, Phlip wrote:

> Ronald Fischer wrote:
>
>> Is there a principal reason when to prefer call over yield (or vice versa), 
>> or are these only syntactic variations of the same feature?
>
> I am learning to consider 'yield' as a fossil of an early Ruby that could not 
> treat the bound block as a variable. I only use 'yield' as a slight 
> convenience - a few less characters to type - in application-specific code.
>
> When writing API-style code, I always start with &block because it's only a 
> matter of time before I refactor the code and start passing that &block into 
> a helper method.

I think that's premature pessimization :-)  See my other post for some
benchmarks on yield vs. capture-and-call.


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)