lua-users home
lua-l archive

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

--------- Mensagem Original --------
De: Lua list <>
Para: Lua list <>
Assunto: Re: Where Tcl and Tk went wrong; {SPAM?} Re: Where Tcl and Tk went
Data: 31/03/10 14:04

> On Wed, Mar 31, 2010 at 12:52 PM, steve donovan
> <> wrote:
> > On Wed, Mar 31, 2010 at 6:46 PM, Javier Guerra Giraldez
> > <> wrote:
> >> if all you want is encapsulation, polymorphism
> >> and nice syntax, then you don't need any of "several competing
> >> options".
> >
> > OK, but you have to get into metaprogramming fairly quickly - and from
> > that sentence, I don't know which Lua OOP model you're thinking about
> > ;)  It's probably the standard 'metatable.__index == metatable' but
> > maybe not....
> the beauty is that it doesn't matter!  as long as your 'methods' are
> functions that accept the 'object' as the first parameter, and are
> accessible with table lookups (either directly, or with metatables),
> you can use the obj:mth(parms) syntax.
> that's why i don't buy the "we need to standardize!" cries.  all of
> the 'extra' "OOP models" support this syntax, making interoperability
> mostly seamless.  and useless too, since i still haven't seen one that
> gives any real advantage.  i find far easier to do it by hand in the
> very (very) few places where i've needed some inheritance.  in most
> cases simply using the module itself as the 'class' even takes most of
> the metatable handling out of sight.
> -- 
> Javier

This works fine until I want to subclass a class made by someone else using
my own OOP model which I already use extensively in my own code.


Mensagem enviada pelo Microlink Webmail 12.7.8p3