lua-users home
lua-l archive

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


> > Is the natural pair of getenv(), by whatever name,
> > available in LUA? I could not find it.
> > 
> > If it really is missing, is there any _good_ reason
> > for not adding it (again, by whatever name)?
> > 
> 
> Well, setenv() or putenv() are not directly available, but, 
> you can dd the yourself. The good reason for not including them
> is that core of Lua has alway been written in (a subset of) 
> pure ANSI 89 C, without allowing any non-ANSI extensions in 
> the core. If we want non-ansi extensions, we add them ourselves.

Thanks. I already added it myself, that's exactly why 
I got pissed. :) So, ANSI 89 C is the guilty one... 

Now, just a side-note: I added the missing function to 
my LUA API presented to the clients of my platform, but 
hesitated long whether to prefix that function with my 
standard API prefix, or not. Finally I decided not to. 
This is impure, and itching, but how would it look 
in the client code to mg_putenv() something, and then
just getenv() it back at some other place?

So, it would be so nice if sometimes platform layers, 
were "bold" enough to even out some of the unevenness 
instead of following "faithfully" the bumps and pits 
of the underlying layers.

Sab