[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Object-oriented programming in Lua
- From: Mark Hamburg <mhamburg@...>
- Date: Sun, 16 Jan 2005 20:31:08 -0800
on 1/16/05 8:24 PM, Mark Hamburg at mhamburg@adobe.com wrote:
> Polymorphism
> -------------
> Lua does very well with respect to polymorphism. Given method lookup and
> __index and __newindex metamethods, one can implement the following
> interfaces in any number of ways and the client need never be any the wiser:
>
> obj:method( ... )
> obj.field
> obj.field = expression
Lua should perhaps receive some negative marks for the fact that its
primitive operators:
pairs
ipairs
table.insert
table.remove
table.replace
etc.
have no polymorphic support and this isn't really called out.
This is a place where generic functions might make sense.
Mark