Why do proc and lambda return different values for arity?
e.g.
proc { |x = 0| }.arity #=> 0
lambda { |a = 0| }.arity #=> -1
proc {
As mentioned here:(Differences between Proc and Lambda), one of the primary differences between procs and lambda are that "Just like methods, lambdas have strict argument checking, whereas non-lambda Procs have loose argument checking, just like blocks."
Thus, since the arity is based on the number of required arguments, this will change between procs and lambdas.