Subject: Re: Performance difference between struct and CLOS?
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 10 Jan 2009 05:06:01 -0600
Newsgroups: comp.lang.lisp
Message-ID: <drmdnTVk9K-EHPXUnZ2dnUVZ_qadnZ2d@speakeasy.net>
Kenneth Tilton  <kentilton@gmail.com> wrote:
+---------------
| btw, structs "work perfectly well" even if here and there something CLOS 
| offers is needed, because those things can be had other ways with 
| sufficient additional code and without becoming as slow as a CLOS-based 
| solution.
+---------------

Specifically, specialized methods "work perfectly well" on structs.
And since structs provide "single inheritance" via the :INCLUDE option,
DEFSTRUCT + DEFMETHOD gives you most of what non-Lispers think of as
an OO system.

It's probably worth noting that CL allows a struct to be defined
with zero slots, which can come in handy when wanting to change the
behavior of just a few methods of an :INCLUDE'd struct. [I found
myself making use of that when working on a compiler graph problem
where the parent NODE struct already had all the common data that
was needed, other than a unique dispatchable node type.]



-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607