Lisp HUG Maillist Archive

Re: [long answer] Re: copy-object

--- Nick Levine <ndl@ravenbrook.com> wrote:
> means that both CLOS objects and the code that
> accesses them have to
> be more complicated than their structure
> counterparts.

Suppose I want to construct millions of objects, but
only use a few of them, at random, according to the
randomness of external events.  How can I avoid the
delay imposed by millions of make-instance calls?  I'm
thinking now that I should maybe use defstruct
instead, and delegate the functionality to CLOS
objects constructed as needed.  Sort of a "lazy
delegation" paradigm.  But is it really needed?  Isn't
there any way to just construct millions of degenerate
CLOS objects at high speed and let a few of them
metamorphose when needed?


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com


Re: [long answer] Re: copy-object

----- Original Message -----
From: "Eric Smith" <eric3057@yahoo.com>
To: <lisp-hug@xanalys.com>
Sent: Sunday, March 03, 2002 8:41 AM
Subject: Re: [long answer] Re: copy-object


>
> --- Nick Levine <ndl@ravenbrook.com> wrote:
> > means that both CLOS objects and the code that
> > accesses them have to
> > be more complicated than their structure
> > counterparts.
>
> Suppose I want to construct millions of objects, but
> only use a few of them, at random, according to the
> randomness of external events.  How can I avoid the
> delay imposed by millions of make-instance calls?  I'm
> thinking now that I should maybe use defstruct
> instead, and delegate the functionality to CLOS
> objects constructed as needed.  Sort of a "lazy
> delegation" paradigm.  But is it really needed?  Isn't
> there any way to just construct millions of degenerate
> CLOS objects at high speed and let a few of them
> metamorphose when needed?

If you have millions of CLOS objects and you only use a few, of what use is
the unused data?  Why have it in the first place?   Just in case?  Perhaps
you can be more specific of what you are doing.  Sounds like you need a
better state machine.

Wade


Re: [long answer] Re: copy-object

Eric Smith <eric3057@yahoo.com> writes:

> randomness of external events.  How can I avoid the
> delay imposed by millions of make-instance calls?  I'm
> thinking now that I should maybe use defstruct
> instead, and delegate the functionality to CLOS
> objects constructed as needed.

it's a bit difficult to understand why you'd need to "materialize"
these objects at all before you actually need them, but if you need
to, why not represent them as argument lists to make-instance?

-- 
  (espen)


Updated at: 2020-12-10 09:02 UTC