According to the MRI source , it seems that the iterator used in select uses its arguments, but map does not and passes them without packaging; the block in the latter case silently ignores the other arguments.
The iterator used in select :
static VALUE find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv) { ENUM_WANT_SVALUE(); if (RTEST(rb_yield(i))) { rb_ary_push(ary, i); } return Qnil; }
The iterator used in map :
static VALUE collect_i(VALUE i, VALUE ary, int argc, VALUE *argv) { rb_ary_push(ary, enum_yield(argc, argv)); return Qnil; }
I am sure that the ENUM_WANT_SVALUE() macro is used to turn the value passed into the block into the value of the splat array (as opposed to a tuple in which the last arguments are silently ignored). However, I do not know why it was designed in this way.
Platinum azure
source share