[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Overloading prefix operators...

Randy R

11/28/2006 8:30:00 PM

Okay, so "operator overloading" is wonderfully trivial and natural in
Ruby but it just occured to me that I have no idea how to change the
behaviour of prefix operators like negate, "-x", where x is an object...
How does one do this?
Thank you...



1 Answer

Gavin Kistner

11/29/2006 2:00:00 AM

0

Just Another Victim of the Ambient Morality wrote:
> Okay, so "operator overloading" is wonderfully trivial and natural in
> Ruby but it just occured to me that I have no idea how to change the
> behaviour of prefix operators like negate, "-x", where x is an object...

Look in the table here:
http://phrogz.net/ProgrammingRuby/language.html#operatore...