[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The many lengths of Lua
- From: Martin <eden_martin_fuhrspam@...>
- Date: Thu, 15 Sep 2016 21:55:07 -0700
On 16-09-15 02:26 AM, Igor Ehrlich wrote:
> local max_idx = table_maxkey({1,2,8}) -- should return '8'
IMO it should return 3 of have another name.
Personally I do not wish to verify any utility functions. For example
local original_pairs = _G.pairs
_G.pairs = function(...)
print('pairs_called')
print_stacktrace()
return original_pairs(...)
end
or even
_G.pairs = _G.error
And what are you going to do in these cases, refuse to execute? Then
that malicious user will blame your code anyway because it still does
not work.