Before you have a look at the Python code, some remarks.
After the third rework of my code, I started renaming concepts. For my taste, e.g. "vtable" is not so intuitive. You will see that I introduce a "Object" class, a "ObjectBehavior" class and a "BehaviorBehavior" class in the code. Furthermore, I changed the names for the methods. They are now called "addClosure", "lookupClosure", "createObject", and "createBehavior". I think, the intentions of the object model get much clearer with the names changed.
When it comes to bootstrapping, I think that the code in Fig. 15 does not precisely re-construct the object model as shown in Fig. 5. When you look at the Python code, you'll see that the hard coded approximation and the bootstrapped model match quite nicely. This was also a main motivation to change names, as mentioned above. I have the feeling that it's now somewhat easier to see what is done in the paper and how the object model is "born".
lookupClosure = "lookupClosure"
addClosure = "addClosure"
createObject = "createObject"
createBehavior = "createBehavior"
self.method = method
self.data = data
self.behavior = behavior
self.data = data
class ObjectBehavior(Object): # formerly 'VTable'
assert delegate == None or isinstance(delegate,ObjectBehavior)
self.delegate = delegate
class BehaviorBehavior(ObjectBehavior): # formerly 'VTableVTable'
def _addClosure(context,obj,key,closure): # see 'addMethod' (Fig. 10)
obj.data[key] = closure
def _lookupClosure(context,obj,key): # see 'lookup' (Fig. 11)
if key in obj.data:
if obj.delegate != None:
def _createObject(context,obj,data=None): # see 'allocate' (Fig. 12)
def _createBehavior(context,obj,delegate=None): # see 'delegated' (Fig. 13)
addClosureClosure = Closure(_addClosure)
lookupClosureClosure = Closure(_lookupClosure)
createObjectClosure = Closure(_createObject)
createBehaviorClosure = Closure(_createBehavior)
def send(obj,messageName,*args,**kwds): # see 'function send()' p.5
closure = bind(obj,messageName)
def bind(obj,messageName): # see 'function bind()' p.5
if obj.behavior == obj:
closure = lookupClosureClosure.eval(obj,messageName)
closure = send(obj.behavior,lookupClosure,messageName)
# Bootstrap the object universe (Fig. 15)
_bb_ = BehaviorBehavior()
_b_ = send(_bb_,createBehavior,delegate=_bb_) # just an example
_o_ = send(_b_,createObject) # just an example
Any comments are welcome.