From: Adam Gardner Date: 2009-02-25T13:45:41+09:00 Subject: Infinite loop with Singleton mixin This loops inifitely, but it doesn't seem like it should. -- require 'singleton' class SingleThing include Singleton def initialize @a = OtherThing.new end end class OtherThing def initialize @single_ref = SingleThing.instance end end a = SingleThing.instance --- It looks as if the the SingleThing.instance method doesn't start returning the allocated instance until initialize has *finished*, but it seems to me it should start returning the allocated instance as soon as initialize *starts*. Otherwise, methods called during initialize (and the methods they call, and so on) can't refer back to the singleton object using SingleThing.instance. Any thoughts? -- Posted via http://www.ruby-forum.com/.