From: Repenning Alexander
Subject: Constant slot access-time for multiple inheritance schemes
Date: 
Message-ID: <1991Sep22.203436.13409@colorado.edu>
Constant slot access-time for multiple inheritance schemes

In single inheritance object schemes (e.g., CL structures using the
:include option) accessors of super classes (types) can also access
slots of their sub classes in constant time because the slot layout of
a sub classe is a simple, compatible extensions of its super class
layout. Typically, structure implementations will render slot
accessors into array accesses with an index determined at structure
DEFINITION TIME.

In multiple inheritance schemes the story is more complex. Sub class
layouts are no longer compatible with their super class layouts, i.e.,
slot layouts of super classes can no longer be viewed as simple
projections of their sub class slot layout.

PCL (at least the version I worked with) resolved this problem by
determining the index of a slot at access time using linear search. My
question now is how could this mapping be resolved efficiently at
class DEFINITION TIME instead of using search or hashing at ACCESS
TIME? How are efficient native CLOS implementation doing this? I'd
appreciate any pointers.

A naive approach would be to store a look up table(s) indexed by the
slot name and the class. Such a table would be either very sparse or
highly redundant. I assume that there must be a better approach.

Btw, is it true that some CL implemetations implement structures with
CLOS objects?

  Alex