[#1611] set_trace_func/Array#fetch error — "Nathaniel Talbott" <nathaniel@...>

I've reduced the error I reported in ruby-talk:84013 to the following code:

17 messages 2003/10/11

Re: Yielding to a block from a proc?

From: "Christoph" <chr_news@...>
Date: 2003-10-08 20:00:07 UTC
List: ruby-core #1593
Sean Russell wrote:

...
> > def test
> > proc { yield 123 }   # <-- captures block passed to test
> > end
> >
> > p = test { |a| puts "Got #{a}" }
> >
> > p.call()
> >
> > Though this is fairly weird (does anyone use it?), it's entirely in keeping
> > with the fact that blocks have access to the blocks that were passed into
> > their scope:
> 
> How does that matter?

It seems to me that George gave a good explanation why passing
blocks to procs doesn't make sense  in the first place, since this 
already happens, albeit  differently, anyway?


/Christoph 

In This Thread