Re: Named metatables (type-named data), similar to typedef of structs in C
[
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: 2019年10月25日 00:12:33 -0500
On 2019年10月24日 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