[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Possible to add methods in Lua to metatables defined in C?
- From: liam mail <liam.list@...>
- Date: Thu, 3 May 2012 18:38:57 +0100
On 3 May 2012 18:26, steve donovan <firstname.lastname@example.org> wrote:
> On Thu, May 3, 2012 at 5:46 PM, Andrew Budd <email@example.com> wrote:
>> What I would like to do is add additional methods to those metatables from
> Totally possible - it's a table, and you can add things to it.
>> mt = getmetatable(io.stdout)
>> mt.read2 = function(self) return self:read(),self:read() end
Unless it is specifically prevented using the "__metatable" key.
 pedantic and just for completeness.