lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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