From: Daniel Brockman Date: 2005-07-20T02:59:16+09:00 Subject: Re: Instance Eval of a Proc "Ara.T.Howard" writes: > the behaviour of Foo.method(:show_name) does exactly as > advertised - binding the method to the class Foo along > with that notion of self and instance vars. That is not in dispute. > so the binding of self for the duration of instance_eval > is definitely working Wait, wait, wait... timeout! Isn't the whole point of ‘instance_eval’ to change the binding of ‘self’? (I must admit I never fully understood the scoping rules, especially when various kinds of ‘eval’ is involved.) > [...] > in the cases like > > f.instance_eval &my_proc > > it has not already been set and is then set for the call. > eg. Foo::method binds exactly as f.instance_eval does - > only a layer deeper. So, in Ruby, there are two kinds of procs — ones that are bound “deeply”, and ones that are bound “shallowly”? Well, that's an interesting concept. > anyhow it seems consistent - but perhaps not intuitive. It seems consistent to me only after you introduced the concept of “deeply-bound” vs. “shallowly-bound” procs. -- Daniel Brockman So really, we all have to ask ourselves: Am I waiting for RMS to do this? --TTN.