andrew-d/lua-ext — pull request #2 by ryankoppenhaver (2013-09-14 08:06:53+00:00)
Title: ComputerCraft port

This incorporates my previous pull request; so you can skip that if you want. (I assume that if you've already applied it, git/GitHub will do the right thing.)

So, I made platform.lua work under ComputerCraft. It exports an `is_minecraft` constant, plus returns appropriate values from `platform()` ("minecraft") and `architecture()` ("computer" or "turtle").

`lua_version` is garbage (because `_VERSION` is "Luaj-jse 2.0.3", and you're expecting "Lua 5.x".) But I don't actually know what version of Lua that corresponds to, so rather than make something up, I just left it alone for now

Most of the other libs don't work; the major blocker there is implementing `require()`. You could half-ass it with something like...

require = function(f) dofile(f) end

...if you wanted to, but I can't be bothered, at least not now that it's one in the morning.

PS I also fixed your windows detection, as you were using `is_windows` in one place and `_is_windows` elsewhere.