2011/11/19 John Lee <johnel...@gmail.com>: > Surprised this capability hasn't come up before because doesn't > sound technically difficult to do.
The problem is simply that at the time of compiling the unit all the function calls within it are already statically resolved and everything is cast in concrete. Pascal is a static language. It does NOT try to resolve each and every function call at runtime by looking up their names to see which one matches under the current circumstances like some highly dynamic languages do (at the cost of speed), instead each function call is completely resolved at compile time. Of course sometimes (quite often) the need arises to replace certain function calls within a library or a framework at a later time (decide at runtime which function to call), this is known as late binding, for this there is no other way than to either simply use a callback function (a procedure variable (as the name implies: the procedure is variable, not constant), this is the pragmatic simple C like approach best suited for simple things) or do the same with inheritance and overriding virtual methods (this is basically just another way of solving the exact same problem: specializing the behavior of some generic library code). Bernd _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal