From: George Ogata Date: 2002-08-09T00:46:43+09:00 Subject: Re: Is There an Inverse of 'rb_define_method'? William Djaja Tjokroaminata wrote: > Hi, > > I don't think it is similar to get the name of a variable. When Ruby > calls a method, in the background it must call a C function. I want to > get the pointer of this function, not its name. > > The problem is in my case, someone else (the user) will define the method > in Ruby, and so I cannot record it when the method is defined. > > Basically, in my extension, instead of writing > > rb_funcall (obj, rb_intern ("func_name"), n, ...); > > I just want to call the function directly, something like > > func_name_ptr (obj, n, ...); > > to reduce the overhead (because this call is done hundreds of thousands > times per second). > Oops. I misread yor post. I saw the "define_method" part of "rb_define_method" and assumed "Module.define_method". (Never mind the stuff about function pointers... :)) Sorry, I don't know much about ruby internals or writing extensions. Hopefully someone else here can help you.