From: nobu.nokada@... Date: 2002-08-10T18:28:38+09:00 Subject: Re: Is There an Inverse of 'rb_define_method'? Hi, At Fri, 9 Aug 2002 22:04:07 +0900, William Djaja Tjokroaminata wrote: > In this case, then, instead of "rb_obj_method" which returns a VALUE, can > we have another function which will return directly the function pointer > itself? Because we are in the realm of C already, probably it is better > to bypass Ruby VALUE intermediary. (In my Ruby-C world, the C side does > not need to deal with VALUE unnecessarily; only when interfacing with the > Ruby user the data needs to be converted into VALUE.) You know why it can't work: > 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. And also, how can you know about the arguments? If you will let users choose from functions you provide, you can hold the pointer internally. Otherwise, it would be impossible in general. C has no such dynamic feature. -- Nobu Nakada