lua-users home
lua-l archive

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

>Didn't test this myself but how should `write' know how to emit userdata???
>Maybe you meant something like this (untested too ;-):
>static tobinary(lua_State* L)
> double x = luaL_check_number(L, 1);
> lua_pushlstring(L, (const char *)&x, sizeof(x));
> return 1;

Yes, this is much simpler (and can be used with `write'). Sorry about the noise.