lua-users home
lua-l archive

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


On Tue, Jun 14, 2011 at 3:11 PM, Jerome Vuarand
<jerome.vuarand@gmail.com> wrote:
> For Lua itself it's mostly there:
> http://hg.piratery.net/electronmeat/src/tip/srcweb/lua-5.1.4/lua-wstring.patch

Yes, I see - would be hard to do all that without actually patching the core.

This is a useful resource for anybody wanting to maintain a UTF-8 safe
Lua 5.1.4 version.

> It's not public yet because I'd like to replace most of the manual
> bindings with generated ones, to ease the addition of new ones.

I choose to use the semi-evil option of preprocessed C code:

def sleep(Int millisec) {
  Sleep(millisec);
  return 0;
}

gets translated into

static int l_sleep(lua_State *L) {
  int millisec = luaL_checkinteger(L,1);
  #line 440 "winapi.l.c"
  Sleep(millisec);
  return 0;
}

and an entry to register it:

   {"sleep",l_sleep},

It does make life easier, without losing any control over the source -
just adds the boilerplate code.

steve d.