----- Original Message -----
From: "Dave Thomas" <Dave / PragmaticProgrammer.com>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Tuesday, October 01, 2002 9:00 AM
Subject: Re: thoughts on typelessness


> William Djaja Tjokroaminata <billtj / y.glue.umd.edu> writes:
>
> > Hi,
> >
> > For me, it is because I assume that my code user (sometimes including
> > myself) will make mistakes, such as giving the code a String when a
Fixnum
> > is expected.  Therefore, so that I can catch the error as early as
> > possible (to give more useful hints to the user that it is his/her input
> > that is wrong, not the code), I usually code
> >
> >     def func (a)
> >         raise "type error" unless a.kind_of? Fixnum
> >         ....
>
> Ruby types are not releated to classes. They're related to object
> protocols (the infamous Duck Typing). That's what gives Ruby much of
> its appeal. Testing for classes is really very poor style, and
> artificially constrains the users of your code.

How universal is this terminology, especially
in Rubyland? After all, isn't #class basically
a synonym for #type?

Hal