lua-users home
lua-l archive

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


On 29 June 2017 at 14:09,  <temp212@gorodok.net> wrote:
> BUT, the problem is there is no way to set it as metatable to newly created
> tables automatically, to make code like {x,y,z} * {1,0,1} + 5 working.


function m(t)
    return setmetatable(t, mathematicmetatable)
end

m{x,y,z} * m{1, 0, 1} +  5

-- 
Javier