From 3044a0bcd90b2176ed471a6fb970ad37d5f162cd Mon Sep 17 00:00:00 2001 From: normal Date: Sun, 15 May 2016 21:11:33 +0000 Subject: [PATCH] proc.c: fix RDoc of Proc#===/call/yield/[] [Bug #12332] Since r52050 ("proc.c: enable optimization of Proc#call") for [Feature #11569], we need to maintain this documentation in a way RDoc comprehends. This is probably not worth fixing in RDoc itself since this uses a non-standard internal C API which is subject to change without notice. ref: http://mid.gmane.org/20160429212836.GA16605@dcvr.yhbt.net http://mid.gmane.org/1461959651.806728.670.51764@mail.rambler.ru http://blade.nagaokaut.ac.jp/ruby/ruby-talk/435458 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ proc.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index d454f91e86..a425abf795 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon May 16 06:06:21 2016 Eric Wong + + * proc.c: fix RDoc of Proc#===/call/yield/[] + [Bug #12332] + Sun May 15 20:55:31 2016 Masatoshi SEKI * lib/drb/timeridconv.rb: don't use keeper thread. [Bug #12342] diff --git a/proc.c b/proc.c index ca0158bc58..850de22634 100644 --- a/proc.c +++ b/proc.c @@ -733,6 +733,10 @@ rb_block_lambda(void) /* CHECKME: are the argument checking semantics correct? */ /* + * Document-method: call + * Document-method: [] + * Document-method: yield + * * call-seq: * prc.call(params,...) -> obj * prc[params,...] -> obj @@ -2919,6 +2923,13 @@ Init_Proc(void) rb_add_method(rb_cProc, rb_intern("yield"), VM_METHOD_TYPE_OPTIMIZED, (void *)OPTIMIZED_METHOD_TYPE_CALL, METHOD_VISI_PUBLIC); +#if 0 /* for RDoc */ + rb_define_method(rb_cProc, "call", proc_call, -1); + rb_define_method(rb_cProc, "[]", proc_call, -1); + rb_define_method(rb_cProc, "===", proc_call, -1); + rb_define_method(rb_cProc, "yield", proc_call, -1); +#endif + rb_define_method(rb_cProc, "to_proc", proc_to_proc, 0); rb_define_method(rb_cProc, "arity", proc_arity, 0); rb_define_method(rb_cProc, "clone", proc_clone, 0);