From: Riley Lynch Date: 2001-11-15T21:45:04+09:00 Subject: [ruby-talk:25257] NOEX_CFUNC: feature or bug? Perhaps one of the astute readers of this list can explain the sense of the following behavior. If not, I'll file a bug report. Methods that are defined in C are flagged with NOEX_CFUNC. NOEX_CFUNC is defined to be the same as NOEX_UNDEF ("node.h"), which is used to inhibit "super" method lookups. Because NOEX_CFUNC and NOEX_UNDEF are the same, functions defined in c cannot call rb_call_super() without raising this exception: superclass method `bar' must be enabled by rb_enable_super() (NameError) Test code to replicate this is included below my sig. Enabling the function with rb_enable_super does work. My question is: Is this behavior (super disabled by default on CFUNCs) intentional? The other thing that tickled my spidey-sense is that NOEX_CFUNC only appears in the code where it is set, so its only current behavior is to "cross-test" as NOEX_UNDEF. While on the subject: What does "noex" stand for? Thanks, --Riley --=( c )=------------------------------------------------- #include "ruby.h" static VALUE bar (int argc, VALUE *argv, VALUE self) { rb_call_super(argc, argv); return rb_str_new2("bar"); } void Init_Foo () { VALUE myClass = rb_define_class("Foo",rb_cObject); rb_define_method(myClass,"bar",bar,-1); } --=( ruby )=---------------------------------------------- require "Foo" class Object def bar puts "in Object#bar" end end f = Foo.new puts f.bar