Hi --

On Sun, 9 Nov 2003, Ryan Pavlik wrote:

> On Sun, 9 Nov 2003 10:07:50 +0900
> dblack / wobblini.net wrote:
>
> > On Sun, 9 Nov 2003, Ryan Pavlik wrote:
> <snip>
> > > As in the previous post, this is possible, but there is no incentive
> > > to do so.  If you want to break your own code, there are quicker and
> > > easier ways.
> >
> > You must not be a big fan of class methods :-)
>
> I'm not sure what your point is here.  The only conceivable point I
> can see is that class methods are singleton objects of type Class, and
> that if I ask for a Class, I may get one, but it won't be the exact
> API of Class if I use class methods.

The point is that objects which have methods defined in their
singleton classes are no longer of the same type as freshly-minted
objects from their original (non-singleton) class.  For example, here:

  class A; def self.m; end; end
  class B; end

A and B are of different types.  This isn't exactly news, but my sort
of meta-point was that the phenomenon of type deviating from class
(and class-checking therefore *not* being a reliable indicator of an
object's behavior) isn't arcane or improbable or irresponsible or
"broken" programming.  This is why I feel there is a kind of impedance
mismatch between the programming environment offered by Ruby and the
habitual assumption or expectation that type will correspond to class.


David

-- 
David Alan Black
home: dblack / wobblini.net        # New email address
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav