From: Kornelius Kalnbach Date: 2010-02-23T16:46:30+09:00 Subject: [ruby-core:28305] Re: [Feature #1082] add Object#singleton_class method On 23.02.10 08:14, Shugo Maeda wrote: > Today, I talked with Matz, and he has finally agreed with the use of > the term "singleton class." The reason why he has chosen the term > "singleton class" is that we have already had > Kernel#singleton_methods. Yay! \o/ > Then, the next issue is whether Kernel#singleton_class should create > an eigenclass when the receiver has no eigenclass. It would be better > to have an optional argument (singleton_class(true/false) or > singleton_class(:create => true)?) to switch the behavior. I always perceived singleton classes to be transparently created in the background. Would it be wise to give the programmer access to its existence status? (I assume singleton_class(false) == nil would behave like a singleton_class? method.) Today, Ruby has no way of telling whether an object already has a singleton class, or am I wrong? Also, why would I ask for a singleton_class without using it? [murphy]