On Dec 30, 10:29    
> On Wed, Dec 30, 2009 at 4:34 AM, Robert Klemme
>
> <shortcut... / googlemail.com> wrote:
> > To sum it up: Ruby 1.9 changed lookup rules from lexical (aka static)
> > to dynamic.
>
> That change may not be permanent.
>
> There was a long thread on ruby-core a month or two ago, prompted by a
> question raised by Yehuda Katz about the problems the change was
> causing for existing DSLs like ActiveRecord and RSpec. After various
> proposals to modify the 1.9 behavior to make it more compatible,
> Maeda-san posted this:
>
> http://osdir.com/ml/ruby-core/2009-12/msg00001.html
>
> Matz seems to be in favor of returning to the 1.8 behavior.

What a tangle.

Seems to me there are two desired behaviors: 1) domain behavior, where
by lookup follows from the point of evaluation, and 2) closure
behavior, whereby lookup follows from the point of definition. Both
are perfectly reasonably and depend solely on the need of the
developer's usecase. There is also the compromise position, first try
domain behavior, failing that try closure behavior.

So if I understand correctly, 1.8 and older used closure behavior, 1.9
switched to domain behavior. There were issues with this change. Some
people suggested the compromise position, but Matz rejected that and
has decided to return to the original closure behavior. Is that a
correct summary?

Short of the compromise position, I would think the only complete
solution would be to allow for both approaches via different methods,
eg. instance_eval vs. instance_domain_eval, or perhaps an option,
instance_eval(&b, :closure=>false).