From: fkocherga Date: 2009-12-31T02:30:47+09:00 Subject: Re: Using #include at the instance level? --Apple-Mail-347-418770255 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii >>=20 >> When 'class B < Object' replaced with 'Class.new do' the Ruby 1.8.7 = interpreter complains about uninitialized constant N. What is the big = reason for dynamically defined class to behave so differently? It would = be very non obvious and unexpected behavior. Actually both cases work as = expected in Ruby 1.9.1 and this is correct behavior according to the = Ruby Draft. >=20 > Nice clarification. >=20 > Are there two issues here? This issue and the resolution of constants > via instance_eval? Or are these two aspects of the same issue? I believe they are aspects of the same issue. > In either case, there is no doubt in my mind that 'class B' and 'B =3D > Class.new do' should work the same. I agree, but if constant lookup rules are going to be reverted to 1.8 I = doubt that both forms will behave the same.=20 -- Fedor Kocherga http://sidenotes.kocherga.info/ --Apple-Mail-347-418770255--