Is it possible to declare methods with a variable?
1 | local index = { } |
2 | for x, r in pairs ( { 'An' , 'Example' } ) do |
3 | index: [ r ] = function () end -- Doing this throws a syntax error |
4 | end |
rather than
1 | local index = { } |
2 | function index:An () end |
3 | function index:Example () end |