From: Anssi Purola
Subject: Clos vs. Lisp
Date: 
Message-ID: <379B3072.F9137182@pp.inet.fi>
(sorry abou English..)

I've heard that you need write more Lisp-code than Clos-code. Is that
true? I mean, in one test-example Lisp-code is >60 lines, and Clos-code
about 20 lines.. Should I try to learn Clos?

From: David Bakhash
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <cxjvhb8645t.fsf@acs5.bu.edu>
Anssi Purola <············@pp.inet.fi> writes:

> (sorry abou English..)

I think you should worry less about the english, and more about describing
your question enough for people to understand what you're really saying.

> I've heard that you need write more Lisp-code than Clos-code. Is that
> true? I mean, in one test-example Lisp-code is >60 lines, and Clos-code
> about 20 lines.. Should I try to learn Clos?

deciding that something is "good code" doesn't always come down to how many
lines it takes to write something, much the same as how fast the code runs in
the average case.  There's more to it.

CLOS provides mechanisms for programmers to save themselves from writing lots
of trivial accessors and mutators -- something I personally find very useful.
CLOS programs can be very effective in terms of writing programs succinctly.
But that's not why you should learn CLOS.

If you're writing something which either is large, or will one day become
large, and something which you want to be easily extensible, then CLOS is
something you should learn. 

dave
From: Michael Schuerig
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <1dvipex.1n9sk9z1ladupsN@[192.168.1.2]>
Anssi Purola <············@pp.inet.fi> wrote:

> I've heard that you need write more Lisp-code than Clos-code.

Is there really a "versus" between Lisp and CLOS? Does one have to
decide to use one or the other or is there a continuum?

Michael

-- 
Michael Schuerig
···············@acm.org
http://www.schuerig.de/michael/
From: Johan Kullstam
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <m2aesiam3w.fsf@sophia.axel.nom>
········@acm.org (Michael Schuerig) writes:

> Anssi Purola <············@pp.inet.fi> wrote:
> 
> > I've heard that you need write more Lisp-code than Clos-code.
> 
> Is there really a "versus" between Lisp and CLOS? Does one have to
> decide to use one or the other or is there a continuum?

i think one would be hard pressed to do CLOS without Lisp.  CLOS is
the Common *Lisp* Object System.  afaict CLOS is a layer of macros and
some functions within common-lisp to allow an objective programming
style.  hence, when you use CLOS, you use Lisp.

-- 
J o h a n  K u l l s t a m
[········@ne.mediaone.net]
Don't Fear the Penguin!
From: Michael Schuerig
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <1dvm54p.18xuhnn5dzn92N@[192.168.1.2]>
Johan Kullstam <········@ne.mediaone.net> wrote:

> ········@acm.org (Michael Schuerig) writes:
> 
> > Anssi Purola <············@pp.inet.fi> wrote:
> > 
> > > I've heard that you need write more Lisp-code than Clos-code.
> > 
> > Is there really a "versus" between Lisp and CLOS? Does one have to
> > decide to use one or the other or is there a continuum?
> 
> i think one would be hard pressed to do CLOS without Lisp.  CLOS is
> the Common *Lisp* Object System.  afaict CLOS is a layer of macros and
> some functions within common-lisp to allow an objective programming
> style.  hence, when you use CLOS, you use Lisp.

Yes, of course you're right. Alas, I meant something slightly different.
I can't find a better way of putting it than "Does CLOS and plain CL
feel like different languages?"

Anyway, I hope to get my copies of Keene's and Graham's books soon.
Presumably I'll be able to find out for myself then.

Michael

-- 
Michael Schuerig
···············@acm.org
http://www.schuerig.de/michael/
From: Pierre R. Mai
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <87hfmqudvk.fsf@orion.dent.isdn.cs.tu-berlin.de>
········@acm.org (Michael Schuerig) writes:

> Yes, of course you're right. Alas, I meant something slightly different.
> I can't find a better way of putting it than "Does CLOS and plain CL
> feel like different languages?"

Not really.  Since Common Lisp (and Lisp in general) already was quite 
"object-oriented" before the introduction of OO-subsystems (of which
CLOS was not the first, nor probably the last), to me CLOS feels just
like a little extension of the dynamic features of CL.  In effect, I
still write CL code, with CLOS providing a structured way to build
easy extensibility into the fabric of an implementation.

> Anyway, I hope to get my copies of Keene's and Graham's books soon.
> Presumably I'll be able to find out for myself then.

I would also suggest (though I think you might already have a copy)
the AMOP, since it gives you both an example of programming a
non-trivial system using CLOS principles (by showing you the
implementation and protocol design of CLOS in CLOS), and gives some of 
the reasoning behind the design of CLOS.  The reference (snipped from
another post a while back, don't know which version is still
available, I got my copy through other channels a while back):

The Art of the Metaobject Protocol
Gregor Kiczales, Jim des Rivi`eres and Daniel G. Bobrow
The MIT Press, 1991
ISBN 0-262-11158-6 (hardcover)
ISBN 0-262-61074-4 (paperback)

Regs, Pierre.

-- 
Pierre Mai <····@acm.org>         PGP and GPG keys at your nearest Keyserver
  "One smaller motivation which, in part, stems from altruism is Microsoft-
   bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]
From: Thomas A. Russ
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <ymizp0iar8v.fsf@sevak.isi.edu>
········@acm.org (Michael Schuerig) writes:

> I can't find a better way of putting it than "Does CLOS and plain CL
> feel like different languages?"

Not to a large extent.  I think that this is because of several factors:

 (1)  Lisp has always had at least an implicit notion of "objects" in
      the broad sense of various data structures that have their own
      identity.  Integers, symbols and floating point numbers are all 
      objects, albeit provided by the system rather than user code.

 (2)  Lisp objects all have manifest types.  You can just as easily find
      out the type of an integer or fixnum as a user created object.

 (3)  The generic function model means that calls to traditional
      functions and to generic functions which dispatch on their
      arguments look the same.  That promotes a unified feel to the
      language and (along with multiple argument dispatch) was one of
      the arguments for adopting the Common Loops style of object system
      over the message-passing Flavors style object system.

-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu    
From: Thomas A. Russ
Subject: Re: Clos vs. Lisp
Date: 
Message-ID: <ymig128d4gh.fsf@sevak.isi.edu>
Anssi Purola <············@pp.inet.fi> writes:

> I've heard that you need write more Lisp-code than Clos-code. Is that
> true? I mean, in one test-example Lisp-code is >60 lines, and Clos-code
> about 20 lines.. 

This hardly seems like a useful distinction to draw.  In the following:

(defmethod foo ((bar LIST) (x INTEGER))
  (cons x bar))

is this 2 lines of Clos-code or 1 line of clos-code 
and 1 line of lisp code?
What about:

	(foo (list 'x 'y 'z) 3)

is this a line of lisp or clos code?


> Should I try to learn Clos?

Definitely!



-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu