[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua on Reddit again
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 31 Jan 2011 14:33:30 +0200
On Mon, Jan 31, 2011 at 2:18 PM, GrayFace <firstname.lastname@example.org> wrote:
> I'd say metatables stuff may indeed get messy, mostly because there's no
> standard OO.
After all, it's such fun to do our own; sometimes I think this was a
lost opportunity. A straightforward metatable-based OOP scheme is
maybe a hundred lines of code, which hides the 'uncomfortable' stuff
and puts it behind a 'standard' facade. If such a little module were
included in the Lua 5.1 distribution (like strict.lua) then perhaps we
would not have such fragmentation.
> I haven't heard of full OO implementations at all, by which I
> mean support for properties, hence privates; reflection. That's the number 1
> candidate for standard library IMO.
Properties in the sense of getters and setters yes. All the pieces
are out there, but a framework that does it all could suffer in
performance (for instance, you need a special __index to handle
properties, which would also have to look up plain-jane methods). In
general this is probably premature anxiety.