aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-07 14:26:48 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-07 14:26:48 -0200
commit26679b1a48de4f7cfcde985764cb31c78ece4fc3 (patch)
treedf30c6972204791dd6a792dd36c1dd132bc5dbf4 /lapi.c
parente04c2b9aa817ed59b4e05025e0d33bfb3bba8f59 (diff)
downloadlua-26679b1a48de4f7cfcde985764cb31c78ece4fc3.tar.gz
lua-26679b1a48de4f7cfcde985764cb31c78ece4fc3.tar.bz2
lua-26679b1a48de4f7cfcde985764cb31c78ece4fc3.zip
back to upavalues as extra arguments for C closures; this way it's
trivial to make currying.
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lapi.c b/lapi.c
index 2bcabed0..63e6dbfd 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.16 1997/12/22 17:52:20 roberto Exp roberto $ 2** $Id: lapi.c,v 1.17 1998/01/02 17:46:32 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -124,15 +124,6 @@ lua_Object lua_lua2C (int number)
124} 124}
125 125
126 126
127lua_Object lua_upvalue (int n)
128{
129 TObject *f = L->stack.stack+L->Cstack.lua2C-1;
130 if (ttype(f) != LUA_T_CLMARK || n <= 0 || n > clvalue(f)->nelems)
131 return LUA_NOOBJECT;
132 return put_luaObject(&clvalue(f)->consts[n]);
133}
134
135
136int lua_callfunction (lua_Object function) 127int lua_callfunction (lua_Object function)
137{ 128{
138 if (function == LUA_NOOBJECT) 129 if (function == LUA_NOOBJECT)