[plt-scheme] Object oriented programming

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Feb 14 12:50:43 EST 2005

On Feb 14, David J. Neu wrote:
> I was wondering if I could get some opinions about the
> advantages/disadvantages of using the object oriented capabilities
> provided by the requiring mzlib's class.ss versus Swindle's
> CLOS-like system?

[Warning: I might be biased for obvious reasons.]

class.ss gives you a sort of a Java-like object system, except with
various extensions and with classes as normal values.

Swindle gives you a CLOS-like object system which is much more
powerful because it is much more open (grep the web for "meta object
protocol").  The price you pay for the extra strength is:

1. It is slower.  (Generic function dispatch in particular is very
   heavy.)

2. It *much* *MUCH* easier to shoot your foot, and you get many exotic
   guns to do so (some don't even look like guns).

3. Following the CLOS "spirit", abstraction is somewhat weaker: for
   example, generic methods are their own objects, so you don't get
   "private" methods.  (But it is possible to get some protection by
   simply using modules.)

Another point to consider is that Swindle is using a tweaked
base-level language, which is also available without the object
system.


> Is there a object system that is portable among different Scheme
> implementations?

No.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



Posted on the users mailing list.