From: Martin Man Date: 2002-05-27T21:14:21+09:00 Subject: creating singleton class from C++ --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi all, I'm trying to define singleton class from C++, I've tried the two approache= s, without luck 1) cMy =3D rb_define_class ("My", rb_cObject) rb_require ("singleton") rb_mSingleton =3D rb_const_get (rb_cObject, rb_intern ("Singleton")) rb_include_module (cMy, rb_mSingleton) this approach fails at rb_require, since $: is empty, however it seems to me strange to set up $: manually... 2) cMy =3D rb_define_class ("My", rb_cObject) rb_singleton_class (cMy) invoking "puts My.new" then reveals that new instance is created every time =2Enew is called, i seem to missunderstand the meaning of rb_singleton_class function. could someone pls. kick me to the right direction... thx, martin --=20 God: Every time I try to talk to someone it's "sorry this" and "forgive me that" and "I'm not worthy"... -- Monty Python and the Holy Grail --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE88iLeYgJwJG4GAiMRAtJYAJ9MfOv8XwfqE1sJMHtXISCRBDqXOQCdFV1+ yJpxGdAwnoexP8XCL6HbfK8= =x3KJ -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--