From: Mark Hubbart Date: 2004-11-13T15:10:41+09:00 Subject: Re: Are +, -, +=, -=, etc. redefinable methods? Hi, On Sat, 13 Nov 2004 13:39:31 +0900, trans. (T. Onoma) wrote: > On Friday 12 November 2004 11:13 pm, itsme213 wrote: > | If so, is there some magic syntax to define them? > | > | Thanks! > > -= and += are special forms that represent: > > y -= x ~> y = y - x > y += x ~> y = y + x > > A number of other infix operators can be used in the same way. So these are > not redefinable independent of + and -. > > + and - on the otherhand has two forms, infix and unary. (Unary means prefix > operator.) Also, for a chart of all the operators and details on their method-ness, look here: http://phrogz.net/ProgrammingRuby/language.html#operatorexpressions cheers, Mark