From: Charles Mills Date: 2005-04-05T02:29:42+09:00 Subject: Re: Extension question Tom Copeland wrote: > On Tue, 2005-04-05 at 00:24 +0900, Robert Klemme wrote: > > > You can attach the function to Object: > > > > IMHO the appropriate place would be a private singleton method of Kernel > > wouldn't it? At least all other "functions" (gsub, gsub! etc.) are placed > > there... > > Right you are, that's much better... > > Yours, > > Tom you can also put them in a module quite easily: void Init_myext(void) { VALUE m = rb_define_module("M"); rb_define_singleton_method(m, "test", some_func, -1); } now you have M.test() -Charlie