4 ms·
> Except it is not extendable. Function pointers are a good way to achieve extensibility in such cases.
by kgabis 12y ago
> Except it is not extendable.
Function pointers are a good way to achieve extensibility in such cases.
- pjmlp 12y agoYou are basically doing a VMT implementation by hand. I rather let the compiler do the work for me.
- kgabis 12y agoNo, using function pointers does not necessarily mean implementing a vtable.
- pjmlp 12y agoNo, but it feels like it. Oberon and Modula-3 only provide record extensions for OOP, with methods being done via function pointers. In case you aren't familiar with these languages, here is some info. http://www.inf.ethz.ch/personal/wirth/ProgInOberon.pdf http://www.inf.ethz.ch/personal/wirth/ProgInOberon.pdf (Chapter 23) http://en.wikipedia.org/wiki/Modula-3#Object_Oriented http://en.wikipedia.org/wiki/Modula-3#Object_Oriented In Oberon's case, which was lucky to have survived longer at ETHZ than Modula-3 did at DEC/Olivetti, all successors (Oberon-2, Active Oberon, Component Pascal, Zonnon) ended up adding support for method declarations.