lua-users home
lua-l archive

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


On 10/17/06, Sam Roberts <sroberts@bycast.com> wrote:
On Tue, Oct 17, 2006 at 05:01:15PM +0200, Natanael Copa wrote:
> What do you think about this as a start:
>
> env.getenv(name)
> env.setenv(name, value)
> env.environ()

What about:

  env[name]
  env[name] = value


That can be done in lua using the posix functions

env = {}
function env.__index(e,name) return getenv(name) end
function env.__newindex(e,name,value) setenv(name,value) end
function env.__call(e) environ() end
setmetatable(env,env)


--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan