From: Scott McLoughlin
Subject: Structure Inheritance
Date: 
Message-ID: <eBmTqc1w165w@sytex.com>
Howdy,
        For all readers waiting for a non-rwar post....
        Any ideas on implementing structure inheritance?
We want to preserve type checks for safety in slot accessor
functions, but don't want to kill performance.  In particular,
we are looking for an efficient scheme compatible with
inlined accessor functions (the type check is inlined).

For example:

1) define struct FOO
2) make a foo or two
3) compile code that accesses foo slots
4) define struct BAR inheriting FOO slots

Any tips or literature pointers would be appreciated.
P.S. -- DEFSTRUCT structs, not CLOS instances, of course.

=============================================
Scott McLoughlin
Conscious Computing
=============================================
From: Bruno Haible
Subject: Re: Structure Inheritance
Date: 
Message-ID: <32dh71$2h4@nz12.rz.uni-karlsruhe.de>
Scott McLoughlin <····@sytex.com> wrote:

> 1) define struct FOO
> 2) make a foo or two
> 3) compile code that accesses foo slots
> 4) define struct BAR inheriting FOO slots

How about (defstruct (BAR (:include FOO)) ... <more slots for BAR> ...)  ?

> P.S. -- DEFSTRUCT structs, not CLOS instances, of course.

In fact, DEFSTRUCT inheritance provides single inheritance only.


                    Bruno Haible
                    ······@ma2s2.mathematik.uni-karlsruhe.de