[futurebasic] Re: Iridescent green pies...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1997 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Thu, 27 Nov 1997 09:56:11 -0600
David wrote:
> I believe that's how FB^3's object runtime works (late binding) - I'll 
> have to check on it.  What exactly is the benefit of binding at runtime 
> as compared to binding at compile time?

Disclaimer: I'm not entirely clear on the precise definitions of the
binding thing myself.  But, having said that:

Here's one thing that may give you a clue as to whether FB^3 does its
binding late or early: I tried the following (in FBII, of course):

COMPILE 0, _caseInsensitive _macsbugLabels
LOCAL FN myFunction
  x = 5
FN myFunction

When this program drops into the debugger, you can see that the call to
FN myFunction translates into a BSR.S command which does pc-relative (is
that what it's called?) addressing to jump to FN myFunction.  The BSR.S
always jumps (in this example) exactly 58 bytes back to reach the FN. 
Which indicates that its destination can't change at runtime, which
means that FBII (at least) does early binding (which I guess you'd
expect, since the concept of classes and polymorphism doesn't even apply
to FBII).

My roundabout point is: maybe you can do a similar experiment with
FB^3.  I would suspect that if FB^3 does late binding, that the machine
language instructions that implement the function call would have to
involve some kind of indirect addressing, in order to let the
destination change dynamically at runtime.

- Rick