From: Hal Fulton Date: 2004-01-15T13:24:19+09:00 Subject: Re: Nested scopes and the Singleton pattern nobu.nokada@softhome.net wrote: >>First question: Is this a valid way to implement Singleton, or am I >>overlooking something? > > Have you considered about race conditions? > Thank you, Nobu. No, I did not consider race conditions. I suppose singleton.rb is thread safe? > def ABC::XYZ means singleton method XYZ of ABC by itself, so > trailing . is superfluous. Try > > def (ABC::XYZ).new(foo) Ahh, that is clear. But I could not see it before. Thanks very much, Hal