なかだです。

rb_funcall2()を使うとprivate methodも呼べるのに、protected
methodは呼べないというのは、ちょっとヘンな感じがします。


Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.846 diff -U2 -p -u -r1.846 eval.c --- eval.c 11 Nov 2005 17:11:05 -0000 1.846 +++ eval.c 30 Nov 2005 08:03:26 -0000 @@ -5769,11 +5769,11 @@ rb_call(VALUE klass, VALUE recv, ID mid, } - if (mid != missing) { + if (mid != missing && scope == 0) { /* receiver specified form for private method */ - if ((noex & NOEX_PRIVATE) && scope == 0) + if (noex & NOEX_PRIVATE) return method_missing(recv, mid, argc, argv, CSTAT_PRIV); /* self must be kind of a specified form for protected method */ - if ((noex & NOEX_PROTECTED)) { + if (noex & NOEX_PROTECTED) { VALUE defined_class = klass;
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦