[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Try lua in your browser
- From: James Turner <james@...>
- Date: Wed, 24 Nov 2010 10:32:15 -0500
On Wed, Nov 24, 2010 at 11:22:03AM +0000, Peter Cawley wrote:
> On Wed, Nov 24, 2010 at 5:22 AM, James Turner <james@calminferno.net> wrote:
> > I no I'm late to the game, but I've just discovered Lua and have fallen
> > in love. As an exercise to get familiar with the language, I have
> > created an interactive lua console that runs in your browser at
> > http://trylua.org.
>
> In my opinion, the standard library has been overly restricted, and I
> would expect more of the following to be available: _G, pcall, load,
> loadstring, getmetatable, setmetatable, string.dump, getfenv, setfenv.
> On a related note, the fact that pcall is not available, but xpcall
> is, looks like an oversight. Finally, behaviour on infinite loops
> (e.g. enter "while true do end" or "x = [[x]]; while true do x = x ..
> x end") seems to be to run forever.
>
I've fixed it so it limits how long the lua script can run. A loop like
that will end with an "Epic fail!" now. Thanks for discovering it.