lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Steve Donovan,

"virtual method"  is really not a concept that makes sense in dynamic languages.

I believe maybe you and Javier Guerra Giraldez would be right.
I have almost no experience in such a language like lua.

I will keep this in mind.

Thank you.
Journeyer


----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m
----------------------------------------


2014-02-26 17:15 GMT+09:00 steve donovan <steve.j.donovan@gmail.com>:
On Wed, Feb 26, 2014 at 9:50 AM, Andrew Starks <andrew.starks@trms.com> 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
involved.

"virtual method"  is really not a concept that makes sense in dynamic languages.