From: Yukihiro Matsumoto Date: 2011-12-12T00:57:32+09:00 Subject: [ruby-core:41590] [ruby-trunk - Bug #5694][Rejected] Proc#arity doesn't take optional arguments into account. Issue #5694 has been updated by Yukihiro Matsumoto. Status changed from Assigned to Rejected We are not going to add incompatible changes to trunk, unless we see consensus after discussion. I think this is not the case. Currently and for near future, arity ignores optional arguments. Use #parameters or propose new API like #arity_range (in a separate proposal). ---------------------------------------- Bug #5694: Proc#arity doesn't take optional arguments into account. http://redmine.ruby-lang.org/issues/5694 Author: Marc-Andre Lafortune Status: Rejected Priority: Normal Assignee: Yukihiro Matsumoto Category: Target version: ruby -v: - Currently: ->(foo = 42){}.arity # => 0, should be -1 This is contrary to the documentation and to what we should expect from the equivalent method definition. Fixed in trunk, requesting backport for the 1.9 line. -- http://redmine.ruby-lang.org