On 5/4/07 7:42 PM, "Rici Lake" <[EMAIL PROTECTED]> wrote:
> In Lua, setting to nil is equivalent to deletion. So I think this should be: > > if (lua_isnoneornil(L, 3) > apr_table_unset(t, key); > else { > const char *val = luaL_checkstring(L, 3); > apr_table_set(t, key, val); > } +1 > if (val == NULL) > lua_pushnil(L); > else > lua_pushstring(L, val); > +1 > Agreed. Also, it's misleading -- they are APR tables, not Lua tables. Brian M. changed this before committing, I think. >> > This is poor Lua style. You shouldn't assume (or require) the stack to > be empty at the start of the function. Use top-relative (negative) indices > instead -- they are no slower. Until a day before I submitted patch, I had never touched Lua, so I'm sure I have bad style and form :) > Also use lua_{get,set}field for clarity, and luaL_register (luaL_openlib > is deprecated). I had been using the PiL 5.0 for docs and lua-users.org was down most of last week. I got hard copy of 5.1 PiL this weekend, so maybe my style will improve ;) Thanks for all the pointers. I think mod_wombat is almost in a state where I can start actually working on the original problem I needed to solve. Question: what would be the best way to load "other modules" to mod_wombat (not apache modules). For example, I want/need to load the lua pcre stuff, but I don't want to write a new apache module just to hook that into mod_wombat. I am new to Lua, so I am sure there is a better way. Can ping me off list if this seems OT for httpd-dev -- Brian Akins Chief Operations Engineer Turner Digital Media Technologies