It was thus said that the Great bil til once stated:
> I write an application for small system microcontrollers, and I want
> to use similar concepts as Arduino uses.
>
> Mainly I the user has to present a setup function and a loop function
> in the Lua code.
>
> But I do NOT like the idea, that the user would write any more
> complicated Lua coding / invoke functions in the "Lua startup code"
> (out of setup function, and out of Loop function).
>
> Is there an easy way to forbid this?
Document that this should not be done, and trust the user?
Is this allowed?
setup = function() ... end
loop = function() ... end
Would this be allowed?
x = 3
y = x * 5
foo = "There are " .. x .. " foos and " .. y .. " bars"
function setup() ... end
function loop() ... end
because that is, technically speaking, "user code" before setup() and loop()
are defined. I can continue ...
local function foo() ... end
local function bar() ... end
setup = foo
loop = bar
for a silly example.
Do I assume correctly that you do not trust users to write code?
-spc