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