Hi all.

There is the idea (in VERY dirty code):
--
class Proc
  def bound; @bound ||= {} end
  def bind(num, val)
    bound[num - 1] = val
  end

  alias :old_arity :arity
  def arity
    old_arity - bound.size
  end

  alias :old_call :call
  def call(*arg)
    bound.to_a.reverse_each{|num, val| arg.insert(num, val)}
    old_call(*arg)
  end
end
--

Usage:
--
l = lambda{|a,b,c| puts "a=#{a}, b=#{b}, c=#{c}"}

puts l.arity	#=>3

l.bind(2, 'b')

puts l.arity	#=>2

l.call('a', 'c')  #a=a, b=b, c=c
--

Two questions:
1. Does somebody think it is useful?
2. Does somebody already done this in some library?

Thanks.

Victor.