From: Christian Szegedy Date: 2001-11-30T18:56:36+09:00 Subject: [ruby-talk:27045] Extension question Hi! I am trying to write a Ruby extension in an very complex existing environment which was planned for tcl. This environment supports requiring and unloading DLLs. This is very handy for debugging, since one can unload recompile and require the DLLs over and over again without a time comsuming restart of the whole system. The DLLs register their (tcl or in my case: ruby) commands by a startup function. And they have to be able to unregister the commands on unload by a cleanup function. Of course, it would be possible to leave the ruby methods, registered on unload, but it would be error prone and hard to bebug, since the code could be called as the DLL is no more in the memory. Is there some simple way to methods of a class from the extension code? Another question: I would like to enable to create a module from the C-code if it does not exist yet. Is it OK to call rb_define_module, or do I have to check whether the module exists? If I have to check it, what is the simplest way to perform this from the C-code? Of course I could use eval, but it is not very elegant and performant... Best regards, Christian