3 ms·
The issue is that Lua treats functions as "first-class," meaning that they are stored in variables like other data. This is how named functions are created with
by jschwartzi 8y ago
The issue is that Lua treats functions as "first-class," meaning that they are stored in variables like other data. This is how named functions are created within the language, and function syntax is sugar for initializing a variable and stuffing a function into it.
This works with API functions also, which is why this works.