Re: Dynamic inheritance?

From: Erick Gallesio <>
Date: Mon, 06 Feb 1995 11:22:22 +0000

I don't know what is dynamic inheritance and I'm surely wrong here. However,
I will try to give an example were the inheritance of a class is changed

The inheritance scheme is encoded in the class precedence list. Changing it
(it is contained in the cpl field of the class) permits to change the object

For instance,

 STk> (define foo (make <class> :name 'foo))
 STk> (slot-set! foo 'cpl (list foo <number> <object> <top>))
 STk> (describe foo)
 foo is a class. It's an instance of <class>
 Superclasses are:
 Directs slots are:
 Class Precedence List is:

 Field Initializers

 Getters and Setters
 STk> (define x (make foo))
 STk> (define-method M ((x <number>)) 'number)
 STk> (M x)

Note: Fucntions change-class and deep-clone and shallow-clone should be useful
for your job. Since change-class is a method you can specialize it to your

I apologize but there is (not yet) documentation for this stuff. In the
meantime, you can have a look to the file STklos/stklos.stk. All the things
concerning inheritance are written in Scheme.

Hope it helps

                -- Erick

                -- Erick
Received on Mon Feb 06 1995 - 11:22:23 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST