[#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-09 19:29:17 UTC
List: ruby-core #1601
Sean Russell wrote:
...
> I wasn't arguing the usefulness of being able to pass blocks to procs.  In 
> fact, I as much as said that I agree with George on this topic, insofar as I 
> have any opinion at all.  I was proposing that the argument that there would
            ^^^
Ditto.
 
> be scoping conflicts with Procs passed to Procs is a fallacy, in that they 
> would be subject to the same scoping rules that other objects are subject to.

Currently the ``yielding block'' is frozen at (method or proc) definition time
and it is impossible to change it afterwards (this is not exactly a scoping issue
in my book) - if one longs for more flexibility one can explicitly pass Procs as 
parameters around and use Proc::call instead of yield - i.e. we already have 
Procs passed to Procs with the scoping rules you describe.


/Christoph


In This Thread