From: Through Pass Date: 2009-09-13T22:56:01+09:00 Subject: Re: All the core function are buit-in? Yeh, I do have noticed that mapping, but I searched all the source code directory, did not find the ruby method definition ... eg. for the rb_define_method(rb_mEnumerable, "collect", enum_collect, 0); but no source code file included string "enum_collect", only the static lib included ... I am not sure I have the source code tree, but I really downloaded all the ruby src tree by: $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby Any help? ----------------- > Usually toward the end of the C files there's a section where the C > functions are bound to Ruby methods, like this: > > rb_define_method(rb_mEnumerable,"sort", enum_sort, 0); > rb_define_method(rb_mEnumerable,"sort_by", enum_sort_by, 0); > rb_define_method(rb_mEnumerable,"grep", enum_grep, 1); > rb_define_method(rb_mEnumerable,"find", enum_find, -1); > > etc. That's your mapping from C to Ruby. > > > David ---------------- -- Posted via http://www.ruby-forum.com/.