1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vm_eval.c: new names of rb_funcall family

* vm_eval.c (rb_funcallv): add better names of rb_funcall2.
* vm_eval.c (rb_funcallv_public): ditto for rb_funcall3.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-31 08:27:06 +00:00
parent 97498d179e
commit 0544c09761
5 changed files with 29 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Fri May 31 17:26:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_eval.c (rb_funcallv): add better names of rb_funcall2.
* vm_eval.c (rb_funcallv_public): ditto for rb_funcall3.
Fri May 31 17:04:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_new_capa): add better names of rb_ary_new2.

View file

@ -1242,10 +1242,18 @@ rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
Invokes a method. To retrieve mid from a method name, use rb_intern().
Able to call even private/protected methods.
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
Invokes a method, passing arguments as an array of values.
Able to call even private/protected methods.
VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
Invokes a method, passing arguments as an array of values.
Able to call only public methods.
VALUE rb_eval_string(const char *str) ::

View file

@ -527,6 +527,7 @@ Cから文字列を経由せずにRubyのメソッドを呼び出すためには
します.その他に引数の指定の仕方が違う以下の関数もあります.
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv)
VALUE rb_apply(VALUE recv, ID mid, VALUE args)
applyには引数としてRubyの配列を与えます
@ -1258,10 +1259,18 @@ VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
メソッド呼び出し文字列からmidを得るためにはrb_intern()を
使う.
private/protectedなメソッドでも呼び出せる
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
メソッド呼び出し引数をargc, argv形式で渡す
private/protectedなメソッドでも呼び出せる
VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
メソッド呼び出し.
publicなメソッドしか呼べない
VALUE rb_eval_string(const char *str)

View file

@ -1463,8 +1463,10 @@ VALUE rb_eval_string(const char*);
VALUE rb_eval_string_protect(const char*, int*);
VALUE rb_eval_string_wrap(const char*, int*);
VALUE rb_funcall(VALUE, ID, int, ...);
VALUE rb_funcall2(VALUE, ID, int, const VALUE*);
VALUE rb_funcall3(VALUE, ID, int, const VALUE*);
VALUE rb_funcallv(VALUE, ID, int, const VALUE*);
VALUE rb_funcallv_public(VALUE, ID, int, const VALUE*);
#define rb_funcall2 rb_funcallv
#define rb_funcall3 rb_funcallv_public
VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
int rb_scan_args(int, const VALUE*, const char*, ...);
VALUE rb_call_super(int, const VALUE*);

View file

@ -802,7 +802,7 @@ rb_funcall(VALUE recv, ID mid, int n, ...)
* \param argv pointer to an array of method arguments
*/
VALUE
rb_funcall2(VALUE recv, ID mid, int argc, const VALUE *argv)
rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv)
{
return rb_call(recv, mid, argc, argv, CALL_FCALL);
}
@ -817,7 +817,7 @@ rb_funcall2(VALUE recv, ID mid, int argc, const VALUE *argv)
* \param argv pointer to an array of method arguments
*/
VALUE
rb_funcall3(VALUE recv, ID mid, int argc, const VALUE *argv)
rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv)
{
return rb_call(recv, mid, argc, argv, CALL_PUBLIC);
}