Using #include at the instance level?

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.

Nice clarification.

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 =
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.

On Dec 30, 4:34 am, Robert K. [email protected] wrote:

maybe this is due to the last update date of the page in 2007…
to dynamic. IMHO this explains the observed different behavior.
Thanks again for poking.

Very helpful. Thanks for going to all the trouble, Robert. I now see
the issue I am facing laser clear.