[DGD] function pointers

Felix A. Croes felix at dworkin.nl
Fri Jun 24 14:54:20 CEST 2011


Jared Maddox <absinthdraco at gmail.com> wrote:

>[...]
> If you don't think they belong in LPC, then what would you normally
> use instead? An object-based solution? Call-by-name? I agree that this
> isn't important, but it certainly IS convenient.

Under the hood, function pointers are implemented as an array holding
an object and a function name.  The fact that the implementation is so
trivial suggests that function pointers are not in any way essential.

In C, I find that I use function pointers only when I want to simulate
dynamic dispatch, which LPC already has because it is object-oriented.

Thus, I see function pointers in LPC as trivial on a low level of
abstraction, and superfluous on a high level.

Regards,
Felix Croes



More information about the DGD mailing list