Shugo,

I like this a lot. One final suggestion: instance_eval and class_eval should
take arguments like instance_exec. Then, the only difference between
instance_eval and instance_exec would be the constant lookup scope.

It also should not break any 1.8 code since instance_eval does not take
arguments in 1.8.

I'm very excited about this!

Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


On Wed, Nov 18, 2009 at 10:38 PM, Shugo Maeda <shugo / ruby-lang.org> wrote:

> Hi,
>
> 2009/11/17 Shugo Maeda <shugo / ruby-lang.org>:
> > I guess we have four options now:
> >
> > (1) As you suggested, revert to the behavior of Ruby 1.8, and add a
> >    new method (or flag) to enable the new behavior.
>
> My proposal is as follows:
>
> (1) Revert instance_eval, class_eval, and module_eval back to the
> behavior of 1.8.
> (2) But do not revert instance_exec, class_exec, and module_exec.
>
> I have attached a patch.
> My patch also reverts the behavior of class variables, but it may be
> unnecessary.
>
> --
> Shugo Maeda
>