[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Where Tcl and Tk went wrong
- From: spir â <denis.spir@...>
- Date: Thu, 1 Apr 2010 10:45:20 +0200
On Wed, 31 Mar 2010 13:03:22 -0400
Javier Guerra Giraldez <firstname.lastname@example.org> wrote:
> On Wed, Mar 31, 2010 at 12:52 PM, steve donovan
> <email@example.com> wrote:
> > On Wed, Mar 31, 2010 at 6:46 PM, Javier Guerra Giraldez
> > <firstname.lastname@example.org> 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.
And how do you clone? How do you avoid every clone to hold (pointers to) common attributes?
vit esse estrany â