From: "Haase, Konstantin" Date: 2010-02-23T17:19:54+09:00 Subject: [ruby-core:28306] Re: [Feature #1082] add Object#singleton_class method -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Feb 23, 2010, at 08:46 , Kornelius Kalnbach wrote: >> 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? > Agreed. I always assumed that not having a singleton class object for every object was an implementation detail. Konstantin -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) iQEcBAEBAgAGBQJLg4+mAAoJEDb0VmU+GZ4kwhgIAJ4gn9+fm46SX8AGlnpG9/N+ 3X9Hsf43ua80s95Yy9qD15NSFX1BN4beLDKX9Fv9R9TfOPtzSFG2C03DiNE9Nx64 0y4/4ORrCk38sLDxWIsqaRcbLFsPrQnCq1yupF8o8SDuDPhbyzFRR0BM4ebl+D/E hfVZuU/HDg8i63bN6UP3zKqBTx8bS1zQAAeltGFulg7x1l2Q0gq+i1oWWRWu1iFN mjT+fh/r2SW36Yu+F2t1F0IkvayLJ+/nZP73Cs/7z4vF8eK1DFCyjuFWrcJ1d2Gz r6oPmb/1Zt54twQF7bmjz0svHiCHjyJT5amH+2ZBvMURXKiPwU7oRsjfLtMhNqk= =BWKR -----END PGP SIGNATURE-----