On Sun, 05 Mar 2006 21:15:09 +0100, <dblack / wobblini.net> wrote:

> I think I was misunderstanding the relation between your example and
> your explanation.  If I'm (now) right, you were just using Object as
> an example of an enclosing class.  I had thought you were saying that
> Object itself always gets checked before the ancestors.

I used Object because the top-level X is stored in Object and I wanted to  
show that there is a (maybe surprising) difference between:

class << obj
	def h
		puts X
	end
end

and

$obj=obj
class Object
	class << $obj
		def i
			puts X
		end
	end
end

>>> As I understand it, some of this is determined quasi-statically...
>>> though not the singleton class parts, since those can't be determined
>>> at all until runtime.
>>
>> You can think of it as happening "quasi-statically", but actually  
>> class, module and "class <<" are executed almost identically by the  
>> interpreter (only different "preparations").
>
> I mean constant resolution specifically.  But I may be behind the
> times.
>
>
> David
>