[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How am I supposed to use yaci library?(Yet Another Class Implementation)
- From: steve donovan <steve.j.donovan@...>
- Date: Wed, 26 Feb 2014 10:15:07 +0200
On Wed, Feb 26, 2014 at 9:50 AM, Andrew Starks <firstname.lastname@example.org> wrote:
> I think that I don't understand "virtual functions" in this context.
> My understanding was that they are functions that can be redefined by
> classes that are inheriting from the base class that declared it.
Yes, that's exactly what they are; the object carries references to
functions which are resolved at call time (in Lua by table lookup, in
C++ by VMT slot lookup). The key point is that indirection is
"virtual method" is really not a concept that makes sense in dynamic languages.