From: ·······@my-dejanews.com
Subject: A simple query about implementing CLOS
Date: 
Message-ID: <7g1i0b$3kc$1@nnrp1.dejanews.com>
Hi

I've been given a task to determine how to implement a object system in lisp.
I've searched around the net to references about CLOS but have only been able
to find references about how to use CLOS not how its been implemented. 
Knowing almost next to nothing about CLOS I could be missing the obvious. 
Can anyone point me at some online resources that describe simple
implementations about how a object system (e.g. clos ) can be implemented in
lisp or some usefull pointers about how to do it.

Thanks heaps in advance
Jason

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

From: ···········@alcoa.com
Subject: Re: A simple query about implementing CLOS
Date: 
Message-ID: <7g1l2r$6dp$1@nnrp1.dejanews.com>
In article <············@nnrp1.dejanews.com>,
  ·······@my-dejanews.com wrote:
> Hi
>
> I've been given a task to determine how to implement a object system in lisp.
> I've searched around the net to references about CLOS but have only been able
> to find references about how to use CLOS not how its been implemented.
> Knowing almost next to nothing about CLOS I could be missing the obvious.
> Can anyone point me at some online resources that describe simple
> implementations about how a object system (e.g. clos ) can be implemented in
> lisp or some usefull pointers about how to do it.
>
> Thanks heaps in advance
> Jason
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

I recommend that you check out chapter 25 of Paul Graham's "On lisp" book. He
implements a mini-CLOS. The source is available at
www.eecs.harvard.edu/onlisp/ Another later version is available in chapter 17
of his book "ANSI Common Lisp" and the source is also available from the same
web site. -- John Watton Alcoa Inc.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
From: Nick Levine
Subject: Re: A simple query about implementing CLOS
Date: 
Message-ID: <3724536C.74DE04F9@harlequin.co.uk>
Try
    http://www.elwood.com/alu/table/tools.htm#clos

The CLOS Repository at CMU looks good.

- nick



·······@my-dejanews.com wrote:

> I've been given a task to determine how to implement a object system in lisp.
> I've searched around the net to references about CLOS but have only been able
> to find references about how to use CLOS not how its been implemented.
> Knowing almost next to nothing about CLOS I could be missing the obvious.
> Can anyone point me at some online resources that describe simple
> implementations about how a object system (e.g. clos ) can be implemented in
> lisp or some usefull pointers about how to do it.
From: Kent M Pitman
Subject: Re: A simple query about implementing CLOS
Date: 
Message-ID: <sfw90bfo95t.fsf@world.std.com>
·······@my-dejanews.com writes:

> I've been given a task to determine how to implement a object system in lisp.

(use-package 'common-lisp)  ;Ignore this.  It's a CL in-joke.

> I've searched around the net to references about CLOS but have only been able
> to find references about how to use CLOS not how its been implemented. 

I don't understand what you mean.  Common Lisp comes with CLOS built in.
Are you saying you want to implement CLOS in a Lisp but not in a Lisp
that has CLOS already?  Is this a class exercise or are you implementing
a new Common Lisp?  The answers would be very different.

> Knowing almost next to nothing about CLOS I could be missing the obvious. 

The implementation of CLOS is not specified.  The implementation of
almost nothing in Lisp is specified.  Lisp is not about
implementation, it is about contract.  The definition of Lisp dialects
are customarily specified in terms of what contract a function must
satisfy, not what data layout or operational technique must be
employed to yield a successful satisfaction of that contract.

> Can anyone point me at some online resources that describe simple
> about how a object system (e.g. clos ) can be implemented in lisp or
> some usefull pointers about how to do it.

People will have a lot easier time answering this question usefully if
you say more about your goal.  There are publicly available
implementations, but they are not necessarily simple.  For more
information, go to the Association of Lisp Users (ALU) web site for a 
list of implementations and their use restrictions.  There are a number
of them there.  
 http://www.elwoodcorp.com/alu/
is the interim home page for the ALU.

In my personal opinion, which you can argue is reflected in the design
of the language, small and easy to describe and implement languages
make large and unwieldy programs.  The Common Lisp specification is
not small, and even the part about the object system is not small.
I think that makes the system easier to use when you get done building
it.  But it isn't a claim that it's easy to build an efficient
implementation.  Another useful resource for understanding the object
system is Gregor Kiczales' The Art of the Metaobject Protocol, usually
referred to informally as AMOP.  It's a softcover book you can probably
find at a bookstore or at Amazon.com.  I recommend looking through it at
a bookstore first, since depending on your need you might find it's 
more advanced than what you're looking for.  But the MOP (the meta-object
protocol) is the conceptual architectural framework behind CLOS.
CLOS does not require you to implement things as the MOP describes,
but in practice many implementations do and absent a better theory
you should also.

You can probably find a public implementation of all of this that you
can use, but that may defeat your purpose.  If your purpose is to
learn, finding all the code already written may or may not be useful
to you (depending on your taste for reading code).  If your purpose is
to get something done in CLOS, there are already good implementations
out there.