local t = {};
-- C-Lua schneller
for i = 1,10000,1 do
t[i] = i;
end;
-- interessant! C-Lua ziemlich lahm
for i = 1,100,1 do
table.remove(t, i + 1000);
end;
for i = 1,100,1 do
table.insert(t, i + 1000, 1);
end;
-- C-Lua schneller
local sum = 0;
for i = 1,10000,1 do
sum = sum + t[i];
end;
MoonSharp.Interpreter.ScriptRuntimeException: attempt to perform arithmetic on a nil value
at MoonSharp.Interpreter.Execution.VM.Processor.ExecAdd(Instruction i, Int32 instructionPtr) in c:\git\moonsharp\src\MoonSharp.Interpreter\Execution\VM\Processor\Processor_InstructionLoop.cs:line 806
at MoonSharp.Interpreter.Execution.VM.Processor.Processing_Loop(Int32 instructionPtr) in c:\git\moonsharp\src\MoonSharp.Interpreter\Execution\VM\Processor\Processor_InstructionLoop.cs:line 283
at MoonSharp.Interpreter.Execution.VM.Processor.Call(DynValue function, DynValue[] args) in c:\git\moonsharp\src\MoonSharp.Interpreter\Execution\VM\Processor\Processor.cs:line 61
at MoonSharp.Interpreter.Script.Call(DynValue function) in c:\git\moonsharp\src\MoonSharp.Interpreter\Script.cs:line 269
at MoonSharp.Interpreter.Script.DoString(String code, Table globalContext) in c:\git\moonsharp\src\MoonSharp.Interpreter\Script.cs:line 202
The script is executed via a simple DoString(). Both LuaInterface and NeoLua handle it without any errors.