lua-users home
lua-l archive

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



The data mode patch defines a new mode 'd' for loadfile which raises
an error at the lexical stage if any loop construct or function
definition has been found when loading the file.  It's useful to have
if-statements, but for/while/repeat/goto/function are no go!

An interesting idea.

But those of a paranoid persuasion should probably combine it with other techniques (like, good old-fashioned sandboxing and such):

--- whack2.lua ---

local fun = load [[
while true do
  print 'whack'
end
]]

fun()

--- eof ---

Ashwin.