Hi,

I am having confusion with the output of Proc#arity

#arity calculation is being done by -n-1. Where n is the number of

required

argument.

Here is n is 1, so -2. Its okay

proc { |a, *b| }.arity # => -2

Here is also n is 1. But why 1, not -2 ?

proc { |a , b = 0| }.arity # => 1

# –

# Regards,

Arup R.

Debugging is twice as hard as writing the code in the first place.

Therefore,

if you write the code as cleverly as possible, you are, by definition,

not

smart enough to debug it.

–Brian Kernighan