Re: Odd loadstring behaviour.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Odd loadstring behaviour.
- From: "Aaron Brown" <arundelo@...>
- Date: Thu, 3 Apr 2008 16:21:11 -0400
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/