[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Named metatables (type-named data), similar to typedef of structs in C
- From: Javier Guerra Giraldez <javier@...>
- Date: Fri, 25 Oct 2019 00:12:33 -0500
On Thu, 24 Oct 2019 at 23:19, bil til <flyer31@googlemail.com> wrote:
>
> Hi,
> I think it would be very nice, if the function setmetatable( table,
> metatable) would support also the case, that the 2nd parameter metatable is
> a string.
variables are names:
local timetype = { __tostring = timetostring, __add = addtwotimes }
local starttime = setmetatable ({hour=13, minute=25}, timetype)
local endtime = setmetatable({hout=16, minute=12}, timetype)
--
Javier