Hi --

On Tue, 7 Oct 2008, _why wrote:

> On Tue, Oct 07, 2008 at 05:47:23AM +0900, David A. Black wrote:
>> I've only looked at it briefly, and maybe I'm not getting it, but it
>> strikes me as kind of odd to have a situation where bare method calls
>> go to one object and instance variables belong to another. The merit
>> of instance_eval is that, though it changes context, it doesn't
>> introduce a new kind of context.
>
> Mixing in a module for the duration of a block isn't a new kind of
> context, though.  You keep the current scope and get some additional
> methods.  I mean would you think that `require` is odd because it can
> introduce a lot of methods without spelling them all out?

It's not so much a scope thing as a 'self' thing. My understanding is
that it would produce a context where this happens:

   m   # sent to one object
   @v  # instance variable of a different object

I'm very 'self'-centered :-) I'd find it hard to keep track of what
was going on there. (Assuming I'm right about the above example.)


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails  January 12-15   Fort Lauderdale, FL
   Advancing with Rails    January 19-22   Fort Lauderdale, FL *
   * Co-taught with Patrick Ewing!
See http://www.rubypal.com for details and updates!