diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-01-07 14:26:48 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-01-07 14:26:48 -0200 |
| commit | 26679b1a48de4f7cfcde985764cb31c78ece4fc3 (patch) | |
| tree | df30c6972204791dd6a792dd36c1dd132bc5dbf4 /lapi.c | |
| parent | e04c2b9aa817ed59b4e05025e0d33bfb3bba8f59 (diff) | |
| download | lua-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.c | 11 |
1 files changed, 1 insertions, 10 deletions
| @@ -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 | ||
| 127 | lua_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 | |||
| 136 | int lua_callfunction (lua_Object function) | 127 | int lua_callfunction (lua_Object function) |
| 137 | { | 128 | { |
| 138 | if (function == LUA_NOOBJECT) | 129 | if (function == LUA_NOOBJECT) |
