From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-02-19T05:37:44+09:00 Subject: Operator overloading and multiple arguments I'm trying to overload the '<=' operator in a class in order to use it for assignment: class Blah def initialize(value=0) @value = value end def <=(new_val,time=0) puts "time is: #{time}" @value = new_val end end a = Blah.new a<=5 #prints: time is 0 a<=(8,10) #results in parse error, doesn't like the ',' So apparently you can't have more than one argument for an overloaded operator (it actually kind of makes sense) - is there any way to do this? Other than: class Blah def assign_at(new_val,time=0) puts "time is: #{time}" @value = new_val end end a = Blah.new a.assign_at(8,10) ....it just isn't as nice. Phil