On Fri, Apr 12, 2002 at 01:38:20AM +0900, Sean Middleditch wrote:
> Class, object, same difference.  You know what I meant.  (Sorry,
> thinking in terms of the language I'm working on, that doesn't
> differentiate between classes and objects yet).

These are very distinct concepts in Ruby, and it is important to
understand the difference.

Everything in Ruby is an Object.

Every Object is an instance of a Class.

Because everything is an Object, a Class is an Object.

Take the following code:
  class Foo; end
  f = Foo.new

Here, f is an instance of Foo.  f is an Object.  Foo is a Class.  Foo is
also an Object.  f is an instance of Foo, which is a Class, but f is not
itself a Class.  It is an instance of a particular Class.

Paul