lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> There does not seem a function to “de-objectify” a value, nor does there
> seem to be a way to dynamically execute a generated statement.
Not sure what you mean with the last part of this sentence, but as
i've understood it.. you want to load lua strings and execute them?

Lua 5.1.3  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> func = loadstring("print('dynamically generated code!'); function newfunc(param) print(param) end")
> newfunc(5)
stdin:1: attempt to call global 'newfunc' (a nil value)
stack traceback:
        stdin:1: in main chunk
        [C]: ?
> func()
dynamically generated code!
> newfunc(5)
5

/Pierre