Is it possible to extend (or even override) standard library modules. I'd like to be able to do something like
-- eggs.lua
table.spam = function(tab)
return tab[1]
end
and then
-- ham.lua
require('eggs')
table.spam({2,7,1,3})
Yes, it's possible, although the recommendation would be not to modify the standard library namespace, but use tablex instead as some libraries do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With