From: Yehuda Katz Date: 2009-11-22T05:02:55+09:00 Subject: [ruby-core:26860] Re: Ruby constant lookup --00c09f82cc65e0024e0478e71356 Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > Hi, > > 2009/11/17 Shugo Maeda : > > 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 > --00c09f82cc65e0024e0478e71356 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Shugo,

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

It also should not break any 1.8 code since instance_ev= al does not take arguments in 1.8.

I'm very ex= cited about this!

Yehuda Katz
Developer | En= gine Yard
(ph) 718.877.1325


On Wed, Nov 18, 2009 at 10:38 PM, Shugo = Maeda <shugo@ru= by-lang.org> wrote:
Hi,

2009/11/17 Shugo Maeda <shugo@rub= y-lang.org>:
> I guess we have four options now:
>
> (1) As you suggested, revert to the behavior of Ruby 1.8, and add a > =A0 =A0new 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

--00c09f82cc65e0024e0478e71356--