[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [proposal] Libary changes
- From: Sean Conner <sean@...>
- Date: Fri, 7 Oct 2011 16:28:50 -0400
It was thus said that the Great Sebastien Lai once stated:
> On Fri, Oct 7, 2011 at 3:49 PM, Luiz Henrique de Figueiredo
> <email@example.com> wrote:
> >> What I propose is to create a new module named "sys", that will
> >> respectively contain that data instead, like:
> >> sys.argv instead of arg
> >> sys.globals instead of _G
> >> sys.version instead of _VERSION
> > Save the file below and you can do "lua -lsys" though arg will probably not
> > work.
> Good catch. Of course, 'sys' is meant to be a 'virtual' module (quite
> frankly, I don't know if that word is fitting, I haven't felt like
> digging through the Lua source yet), so some serious changes in the
> runtime sources would probably required.
Changes required aren't that bad actually. _G and _VERSION are set in
base_open() (lbaselib.c, and that's the only place they appear in the C
source code) and arg is set in lua.c, so it would be rather minimal changes.
Bigger would be existing Lua code that relies on these variables.