For fun and learning I pasted this demo code ( the sieve of Eratosthenes ) into a LUA sequence block and it crashed inside the Lua sandbox
Have I done something obviously silly ? [ My garden Loves Prime Numbers and I wanted to help out ]
05:20:01.845 [info] Event scheduled at 2021-02-05 05:20:00Z failed to execute: {:lua_error, {:illegal_index, nil, "wrap"}, {:luerl, %{0 => {:table, {:array, 0, 10, nil, 10}, {{{{{:empty, "N", 500.0, :empty}, "_G", {:tref, 0}, {:empty, "_VERSION", "Lua 5.2", :empty}, "assert", {:erl_func, #Function<0.65135778/2 in :luerl_lib_basic."-fun.assert/2-">}, {:empty, "bit32", {:tref, 5}, :empty, "check_position", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}}, "collectgarbage", {:erl_func, #Function<1.65135778/2 in :luerl_lib_basic."-fun.collectgarbage/2-">}, {{:empty, "coordinate", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "current_hour", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {:empty, "current_minute", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "current_month", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {:empty, "current_second", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty, "debug", {:tref, 12}, :empty}}}, "dofile", {:erl_func, #Function<2.65135778/2 in :luerl_lib_basic."-fun.dofile/2-">}, {{{:empty, "emergency_lock", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "emergency_unlock", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {:empty, "eprint", {:erl_func, #Function<3.65135778/2 in :luerl_lib_basic."-fun.eprint/2-">}, :empty}}, "error", {:erl_func, #Function<4.65135778/2 in :luerl_lib_basic.table/0>}, {{:empty, "fbos_version", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "filter", {:lua_func, 0, 2, [], [-1, -2], [{:push_gvar, "coroutine"}, {:get_lit_key, "wrap"}, {:fdef, 0, 0, [], [{:push_last_evar, 1, 2}, {:pop_vals, 1}, {:gfor, [], [{:block, 1, 0, [{:push_vals, 1}, {:store_lvar, 1, ...}, {:push_lvar, ...}, {...}, ...]}]}]}, :multiple, {:fcall, 1}, {:return, 1}]}, {:empty, "find_axis_length", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}}}, "find_home", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {{{:empty, "firmware_version", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "gen", {:lua_func, 0, 1, [], [-1], [{:push_gvar, "coroutine"}, {:get_lit_key, "wrap"}, {:fdef, 0, 0, [], [{:push_lit, 2.0}, {:push_evar, 1, 1}, {:push_lit, 1.0}, {:nfor, {:lvar, "i", 1, 1}, [{:block, 1, 0, [{:store_lvar, 1, ...}, {:push_gvar, ...}, {...}, ...]}]}]}, :multiple, {:fcall, 1}, {:return, 1}]}, {:empty, "get_device", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}}, "get_fbos_config", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {{:empty, "get_firmware_config", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty, "get_position", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "getmetatable", {:erl_func, #Function<5.65135778/2 in :luerl_lib_basic."-fun.getmetatable/2-">}, {:empty, "go_to_home", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty, "io", {:tref, 6}, :empty}}}}, "ipairs", {:erl_func, #Function<6.65135778/2 in :luerl_lib_basic."-fun.ipairs/2-">}, {{{{:empty, "load", {:erl_func, #Function<7.65135778/2 in :luerl_lib_basic."-fun.load/2-">}, :empty}, "loadfile", {:erl_func, #Function<8.65135778/2 in :luerl_lib_basic."-fun.loadfile/2-">}, {:empty, "loadstring", {:erl_func, #Function<9.65135778/2 in :luerl_lib_basic."-fun.loadstring/2-">}, :empty}}, "math", {:tref, 7}, {{:empty, "move_absolute", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "new_farmware_env", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {:empty, "new_sensor_reading", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}}, "next", {:erl_func, #Function<10.65135778/2 in :luerl_lib_basic."-fun.next/2-">}, {{:empty, "os", {:tref, 8}, :empty}, "package", {:tref, 4}, {:empty, "pairs", {:erl_func, #Function<11.65135778/2 in :luerl_lib_basic."-fun.pairs/2-">}, :empty}, "pcall", {:erl_func, #Function<12.65135778/2 in :luerl_lib_basic."-fun.pcall/2-">}, {:empty, "print", {:erl_func, #Function<13.65135778/2 in :luerl_lib_basic."-fun.print/2-">}, :empty}}}, "rawequal", {:erl_func, #Function<14.65135778/2 in :luerl_lib_basic."-fun.rawequal/2-">}, {{{:empty, "rawget", {:erl_func, #Function<15.65135778/2 in :luerl_lib_basic."-fun.rawget/2-">}, :empty}, "rawlen", {:erl_func, #Function<16.65135778/2 in :luerl_lib_basic."-fun.rawlen/2-">}, {:empty, "rawset", {:erl_func, #Function<17.65135778/2 in :luerl_lib_basic."-fun.rawset/2-">}, :empty}, "read_pin", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {:empty, "read_status", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty, "require", {:erl_func, #Function<0.80287933/2 in :luerl_lib_package."-fun.require/2-">}, :empty}}, "select", {:erl_func, #Function<18.65135778/2 in :luerl_lib_basic."-fun.select/2-">}, {{:empty, "send_message", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty, "setmetatable", {:erl_func, #Function<19.65135778/2 in :luerl_lib_basic."-fun.setmetatable/2-">}, :empty}, "string", {:tref, 9}, {:empty, "table", {:tref, 11}, :empty}}}, "tonumber", {:erl_func, #Function<20.65135778/2 in :luerl_lib_basic."-fun.tonumber/2-">}, {{{:empty, "tostring", {:erl_func, #Function<21.65135778/2 in :luerl_lib_basic."-fun.tostring/2-">}, :empty}, "type", {:erl_func, #Function<22.65135778/2 in :luerl_lib_basic."-fun.type/2-">}, {:empty, "unpack", {:erl_func, #Function<23.65135778/2 in :luerl_lib_basic."-fun.unpack/2-">}, :empty}}, "update_device", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {{:empty, "update_fbos_config", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}, "update_firmware_config", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, {:empty, "variable", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty, "variables", {:erl_func, #Function<2.27962167/2 in :luerl.encode/2>}, :empty}}}}}, nil}, 1 => {:table, {:array, 3, 10, nil, {nil, {:erl_func, #Function<2.80287933/2 in :luerl_lib_package."-fun.preload_searcher/2-">}, {:erl_func, #Function<3.80287933/2 in :luerl_lib_package."-fun.lua_searcher/2-">}, nil, nil, nil, nil, nil, nil, nil}}, :empty, nil}, 2 => {:table, {:array, 0, 10, nil, 10}, {{{:empty, "_G", {:tref, 0}, :empty}, "bit32", {:tref, 5}, {:empty, "debug", {:tref, 12}, :empty}, "io", {:tref, 6}, {:empty, "math", {:tref, 7}, :empty}}, "os", {:tref, 8}, {{:empty, "package", {:tref, 4}, :empty}, "string", {:tref, 9}, {:empty, "table", {:tref, 11}, :empty}}}, nil}, 3 => {:table, {:array, 0, 10, nil, 10}, :empty, nil}, 4 => {:table, {:array, 0, 10, nil, 10}, {{:empty, "config", "/\n;\n?\n!\n-\n", :empty}, "loaded", {:tref, 2}, {:empty, "path", "./?.lua;./?/init.lua", :empty}, "preload", {:tref, 3}, {:empty, "searchers", {:tref, 1}, :empty, "searchpath", {:erl_func, #Function<1.80287933/2 in :luerl_lib_package."-fun.searchpath/2-">}, :empty}}, nil}, 5 => {:table, {:array, 0, 10, nil, 10}, {{{:empty, "arshift", {:erl_func, #Function<7.95060515/2 in :luerl_lib_bit32."-fun.farshift/2-">}, :empty, "band", {:erl_func, #Function<0.95060515/2 in :luerl_lib_bit32."-fun.fband/2-">}, :empty}, "bnot", {:erl_func, #Function<1.95060515/2 in :luerl_lib_bit32."-fun.fbnot/2-">}, {:empty, "bor", {:erl_func, #Function<2.95060515/2 in :luerl_lib_bit32."-fun.fbor/2-">}, :empty}}, "btest", {:erl_func, #Function<3.95060515/2 in :luerl_lib_bit32."-fun.fbtest/2-">}, {{:empty, "bxor", {:erl_func, #Function<4.95060515/2 in :luerl_lib_bit32."-fun.fbxor/2-">}, :empty}, "extract", {:erl_func, #Function<10.95060515/2 in :luerl_lib_bit32."-fun.fextract/2-">}, {:empty, "lrotate", {:erl_func, #Function<8.95060515/2 in :luerl_lib_bit32."-fun.flrotate/2-">}, :empty}}, "lshift", {:erl_func, #Function<5.95060515/2 in :luerl_lib_bit32."-fun.flshift/2-">}, {{:empty, "replace", {:erl_func, #Function<11.95060515/2 in :luerl_lib_bit32."-fun.freplace/2-">}, :empty}, "rrotate", {:erl_func, #Function<9.95060515/2 in :luerl_lib_bit32."-fun.frrotate/2-">}, {:empty, "rshift", {:erl_func, #Function<6.95060515/2 in :luerl_lib_bit32."-fun.frshift/2-">}, :empty}}}, nil}, 6 => {:table, {:array, 0, 10, nil, 10 (truncated)