[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Jonathan Rees on OO




> Cc: ll1-discuss@ai.mit.edu
> From: Jonathan Bachrach <jrb@ai.mit.edu>
> Date: 13 Dec 2001 12:50:41 -0500
[snip]
> Scheme would be an even smaller gem if it were entirely redefined in
> GOO style.  For example, many of the type-specific functions would be
> replaced by protocols.  In particular, integer? and number? would be
> replaced with isa? and vector-ref and string-ref would be replaced by
> ref.  I'm not sure how to measure this shrinkage, but to my mind, it
> would impose a certain structure and consistency that would make the
> overall language and libraries simpler.  Of course, there would be a
> small increase in complexity by adding GOO itself but I think that
> this would be a well spent one time cost.

I *completely* agree with this.  Using vector-ref? instead of a generic ref
function is a really gross thing about scheme IMO.  It's minor in the Big
Scale Of Things, but if you can make a more elegant, more powerful language
which is as efficient, why not do it?  And Dylan is more efficient that
most (all?) schemes, right?

The neat thing about generic-function based object systems is:

1) they match well the way we think about the world:

   "to add two integers, do this"
   "to add an integer with a real, do that"
   "to add two reals, do that"
   "to add two strings, do that"

2) As a result, it doesn't even feel like an object system.  It's more like
   overloading on steroids.

Mike