From: Glen Able
Subject: CLOS basics
Date: 
Message-ID: <d6nsvo$vhu$1@news6.svr.pol.co.uk>
Just starting to get my head around CLOS, and hoped you could help me get a
few simple things clear...

Is there much to know about CLOS beyond defining classes with some slots,
and then using defgeneric/defmethod to create polymorphic functions?  And
I'm right in thinking that polymorphism can be, for want of a better word,
multidimensional?

In c++ I'm used to creating 'class methods', some of which are polymorphic.
Is defmethod only used for creating polymorphic functions, and for other
functions operating on a class you'd just use defun, passing a class
instance as an argument?

I've seen the (minority?) opinion expressed in this group that CLOS is
actually redundant.  What alternatives are there for working with aggregated
data types etc.?

If I were to create vector, matrix etc. classes for the usual 3d vector math
operations, could I expect to get very good performance?


thanks for any thoughts...
From: Paul F. Dietz
Subject: Re: CLOS basics
Date: 
Message-ID: <-JSdnSt6HYpFHxLfRVn-3g@dls.net>
Glen Able wrote:
> Just starting to get my head around CLOS, and hoped you could help me get a
> few simple things clear...
> 
> Is there much to know about CLOS beyond defining classes with some slots,
> and then using defgeneric/defmethod to create polymorphic functions?  And
> I'm right in thinking that polymorphism can be, for want of a better word,
> multidimensional?

There's also method combination, and features for dynamic redefinition of
classes.  Beyond that, there's the MOP, but that is not part of the ANSI standard.

> In c++ I'm used to creating 'class methods', some of which are polymorphic.
> Is defmethod only used for creating polymorphic functions, and for other
> functions operating on a class you'd just use defun, passing a class
> instance as an argument?

You could define all your functions with defgeneric if you really wanted
to.

> 
> I've seen the (minority?) opinion expressed in this group that CLOS is
> actually redundant.  What alternatives are there for working with aggregated
> data types etc.?
> 
> If I were to create vector, matrix etc. classes for the usual 3d vector math
> operations, could I expect to get very good performance?

While the overhead in CLOS is not as high as it might seem, it does exist,
so you don't want to do something really low level like array access in CLOS
if performance is critical.  In many cases, performance is not critical, but
clarity/extensibility is, and CLOS can help there.

	Paul