From: Dave Thomas Date: 2002-12-02T01:58:29+09:00 Subject: Re: [FAQ] What do some of Ruby's symbols mean? Austin Ziegler writes: > <=>, <=, <, >=, >, ==, != > 1. Relational operators, used to determine the relative > equality of values. All of these symbols, excepting "!=", > are defined as methods on classes. The most common way of > implementing these values is through the [Comparable] mixin, > where it is only necessary to define "<=>" (which must > return a value of -1, 0, or +1). Actually, it's looser than that: the spaceship can return less than zero, zero, or greater than zero. > +, -, *, /, %, ** > 1. Binomial arithmetic operators representing addition (3 + 2), Simple typo for 'binary'. > 2. "<<" also opens an object for modification to make a > singleton-object (one which is not quite like any other > object of its class). In the example below, only the Car > object referred to by "camaro" will have the method > "has_flames?". Possibly "Creates a new class based on a particular object. These object-specific classes are called 'singletons' (or singleton classes). In the example..." > > camaro = Car.new > class << camaro > def has_flames? > true > end > end If a singleton class for a object already exists, << simply modifies it, rather than creating a new one. A common idiom is "class <