On Nov 14, 2007, at 1:27 AM, Xavier Noria wrote:

> According to my trials nor Module#constants neither Module#const_get  
> work with constants defined in enclosing modules:
>
>  module M
>    C = 1
>    module N
>      C # -> 1
>    end
>  end
>
>  M::N.constants # -> []
>  M::N.const_get("C") # -> NameError
>
> Looks as if they only took into account ancestors.

I gues that C is somehow in scope, but there are other examples that  
puzzle me:

   module M
     C = 1
   end

   module PutSomethingInBetweenJustInCase
   end

   module M
     module N
       puts C # -> 1
     end
   end

Why is M::C in scope there?

-- fxn