From: patrick-may@... (Patrick May) Date: 2002-09-14T14:25:06+09:00 Subject: Re: not grasping the method overloading/multi-dispatch thing Here's my best shot: class Object def to_nextValue self end end class Proc def to_nextValue self.call end end class Signal #.... def to_nextValue proc{function.to_s}.call end def assign_at (relTime=0,function=nil) # don't want to extend nilclass, b/c there is bug # in the 1.6 interpreter which can cause segfaults. # this is a sensible guard, unless this is the wrong # behaviour for a false value. function ||= Proc.new #schedule an event @eventQueue[relTime] = function.to_nextValue nextValInQueue = @eventQueue.shift @next_value = nextValInQueue if nextValInQueue end def assign(function=nil) assign_at(0,function) end end maybe to_nextValue could use a better name, but this may do the trick. This is a tough example. ~ Patrick