[fpc-devel] Generics Basics

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Nov 13 17:53:30 CET 2005


On 11 Nov 2005, at 08:50, Micha Nelissen wrote:

> What is "late binding" exactly ? What are you binding ?

Late binding means that the compiler doesn't have to be able to  
figure out at compile time whether or not a particular object  
understands a particular message (aka has a method with a particular  
name), or where this message is located in the VMT (so if you have  
two independent class hierarchies which implement method FOO, you can  
still use obj.foo() and get the correct method called in both cases).

In case the compiler knows the type, the implementation is the same  
as with regular OOP languages. If it doesn't, then the method call  
happens via some kind of hashtable lookup with caching.


Jonas



More information about the fpc-devel mailing list