summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorzverok <zverok.offline@gmail.com>2019-11-20 02:33:20 +0200
committerKoichi Sasada <ko1@atdot.net>2019-11-20 13:42:56 +0900
commit50cc9341450cfbdf9a40df3d38600d8d2854a0a3 (patch)
tree8f946d146e2dca794c05cc63de6f6ef0947f8e01 /proc.c
parentbaf482bab4776f781c3569d9f581e38bbf0548e1 (diff)
Update representation (discussed on ruby tracker)
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2618
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/proc.c b/proc.c
index e37ac1ceb3..9859116baf 100644
--- a/proc.c
+++ b/proc.c
@@ -2830,7 +2830,6 @@ method_inspect(VALUE method)
{
VALUE params = rb_method_parameters(method);
VALUE pair, name, kind;
- int arg_num = 1;
const VALUE req = ID2SYM(rb_intern("req"));
const VALUE opt = ID2SYM(rb_intern("opt"));
const VALUE keyreq = ID2SYM(rb_intern("keyreq"));
@@ -2850,8 +2849,7 @@ method_inspect(VALUE method)
if (NIL_P(name) || name == Qfalse) {
// FIXME: can it be reduced to switch/case?
if (kind == req || kind == opt) {
- name = rb_sprintf("arg%d", arg_num);
- arg_num++;
+ name = rb_str_new2("_");
} else if (kind == rest || kind == keyrest) {
name = rb_str_new2("");
} else if (kind == block) {
@@ -2864,11 +2862,11 @@ method_inspect(VALUE method)
if (kind == req) {
rb_str_catf(str, "%"PRIsVALUE, name);
} else if (kind == opt) {
- rb_str_catf(str, "%"PRIsVALUE"=<default>", name);
+ rb_str_catf(str, "%"PRIsVALUE"=...", name);
} else if (kind == keyreq) {
rb_str_catf(str, "%"PRIsVALUE":", name);
} else if (kind == key) {
- rb_str_catf(str, "%"PRIsVALUE": <default>", name);
+ rb_str_catf(str, "%"PRIsVALUE": ...", name);
} else if (kind == rest) {
rb_str_catf(str, "*%"PRIsVALUE, name);
} else if (kind == keyrest) {