Issue #2709 has been updated by Patrik Wenger.


Yukihiro Matsumoto wrote:
> We don't accept any proposal with the POLS reason by default, since
> the background vary person to person.  So don't be so lazy.  Explain
> why YOU have assumed Kernel#sprintf not to change behavior according
> to the variables $VERBOSE and $DEBUG.

I assumed Kernel#sprintf doesn't change behavior according to the variables $VERBOSE and $DEBUG because there's absolutely no reason to raise if there are too _many_ arguments.
The work can be done by Kernel#sprintf without errors (like when $DEBUG evaluates to false).

Shyouhei Urabe wrote:
> What about it:  raise exceptions as it is when arguments are too _few_, but not
> for too _many_, even when $DEBUG is true.

Thank you, Shyouhei Urabe. That's what I meant. That would be great.
Sorry if I'm wrong, but the change set shown in your post, wouldn't it cause two messages to be printed, if $VERBOSE and $DEBUG are true? Maybe the line should look like this:

if (RTEST(ruby_debug) || RTEST(ruby_verbose)) rb_warn("%s", mesg);

By the way, is this warning really needed? Same reason: If there are too many arguments, there's nothing to complain about. The functionality of Kernel#sprintf isn't affected by too many arguments. So removing the warning as well would be wise I think.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2709

----------------------------------------
http://redmine.ruby-lang.org