0 Members and 1 Guest are viewing this topic.
local function test(...) if arg then print("Lua") -- might have to replace print() with a graphics API call, I haven't use it yet else print("LuaJIT"); endendtest(1, true, 'cool');
LuaJIT handles variable argument functions differently than normal Lua, which is why the above would discern the two.Sorry, but I don't know the graphics API, as I said, I've yet to start messing around
Also, did TI keep the loadstring() function, or did they clear that out for security reasons ?If they kept it, it opens the doors for at least one potential exploit, and the possibility of optimized Lua assembly (though TI-Basic is still probably faster)
Can you explain a little bit more (as you're there )
Having "..." as a function parameter will cause that function to accept any number of inputs.Lua 5.0.* (I think) was the last version to official support converting of variable arguments into a table which is automatically localized (the 'arg' variable).Lua 5.1.4 has compatibility with this feature, LuaJIT does not by default (I think you can enable it).
loadstring(('').dump(function()X''end):gsub('\2%z%z%zX','\0\0\0'))()