Add func.call_by_value

master
Lars Mueller 2021-03-22 18:17:26 +01:00
parent 2005754a46
commit 0d1c5596a6
1 changed files with 5 additions and 0 deletions

View File

@ -33,4 +33,9 @@ function assert(value, callback)
if not value then
error(callback())
end
end
--+ Calls func using the provided arguments, deepcopies all arguments
function call_by_value(func, ...)
return func(unpack(modlib.table.deepcopy{...}))
end