lua-users home
lua-l archive

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


I think the standard response to something like this is to do something like:

line = read_input()
chunk,err = loadstring("return "..line)
if not chunk then
    -- That didn't work, try without the return.
    chunk,err = loadstring(line)
    if not chunk then
	send_error_to_user(err)
	return
    end
end
chunk()

give or take a bit.

Someone correct me if I'm wrong.

	-Etan