From: Ross Bamford [mailto:rossrt / roscopeco.co.uk] > On Mon, 2006-05-08 at 23:07 +0900, Victor Shepelev wrote: > > 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 > > There are a few drawbacks to this approach I think, most of which I > forget right now. A probable biggie is that it won't work with yield: Yes, I know (and disclaimer said about "VERY dirty code"). I've just tried to show raw idea about providing arguments-binding functionality. RubyMurray which you and James have pointed to, is quite good for this. > Ross Bamford - rosco / roscopeco.REMOVE.co.uk Victor.