From 88f020b626d1b5b10b5d12e04bf103409a5e4308 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 19 Jun 1997 15:03:04 -0300 Subject: new interface to "lua_seterrormethod" and "lua_settagmethod", to allow the use of Lua functions too. --- mathlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mathlib.c') diff --git a/mathlib.c b/mathlib.c index 17e301da..bb33db08 100644 --- a/mathlib.c +++ b/mathlib.c @@ -3,7 +3,7 @@ ** Mathematics library to LUA */ -char *rcs_mathlib="$Id: mathlib.c,v 1.23 1997/04/06 14:08:08 roberto Exp roberto $"; +char *rcs_mathlib="$Id: mathlib.c,v 1.24 1997/06/09 17:30:10 roberto Exp roberto $"; #include #include @@ -210,7 +210,8 @@ static struct luaL_reg mathlib[] = { void mathlib_open (void) { luaL_openlib(mathlib, (sizeof(mathlib)/sizeof(mathlib[0]))); + lua_pushcfunction(math_pow); lua_pushnumber(0); /* to get its tag */ - lua_settagmethod(lua_tag(lua_pop()), "pow", math_pow); + lua_settagmethod(lua_tag(lua_pop()), "pow"); } -- cgit v1.2.3-55-g6feb