From: Christoph Date: 2002-09-12T06:18:33+09:00 Subject: Re: Multimethods (was Re: Larry Wall's comments on Ruby) "Joel VanderWerf" wrote .... .... > Without changing Ruby internals, what about something like: > > > module Physics > > Collide = GenericFunction.new {|actor, object, *args|} Nice! ... additionally one could also explicitly specify the number of ``dispatch-relevant arguments ? Collide = GenericFunction.new(2) {|actor, object, *args|} > > # > # The generic function will dispatch on actor and object, but > # simply pass args to the selected method. > # > # The distinction in the block can be detected by checking whether #arity > # returns 3 or -3. > # > > end .... /Christoph