lua-users home
lua-l archive

Re: Odd loadstring behaviour.

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


Polarina wrote:
The above code snippet errors with Lua falsely claiming
that an attempt was made to call a nil value.
Lua's claim is true, because loadstring returns nil and an
error string when there's a syntax or compilation error.
Try this:
a = function (a)
 return a(a)
end
assert(loadstring(
 "print(" .. ("a("):rep(10^6) .. "a" .. (")"):rep(10^6) .. ")"
))()
--
Aaron
http://arundelo.com/

AltStyle によって変換されたページ (->オリジナル) /