public class TailcallVarargs extends Varargs
Varargs that represents a lua tail call
in a Java library function execution environment.
Since Java doesn't have direct support for tail calls,
any lua function whose Prototype contains the
Lua.OP_TAILCALL bytecode needs a mechanism
for tail calls when converting lua-bytecode to java-bytecode.
The tail call holds the next function and arguments,
and the client a call to eval() executes the function
repeatedly until the tail calls are completed.
Normally, users of luaj need not concern themselves with the details of this mechanism, as it is built into the core execution framework.
| 构造器和说明 |
|---|
TailcallVarargs(LuaValue object,
LuaValue methodname,
Varargs args) |
TailcallVarargs(LuaValue f,
Varargs args) |
| 限定符和类型 | 方法和说明 |
|---|---|
LuaValue |
arg(int i)
Get the n-th argument value (1-based).
|
LuaValue |
arg1()
Get the first argument in the list.
|
Varargs |
eval()
Evaluate any pending tail call and return result.
|
boolean |
isTailcall()
Return true if this is a TailcallVarargs
|
int |
narg()
Get the number of arguments, or 0 if there are none.
|
Varargs |
subargs(int start)
Create a
Varargs instance containing arguments starting at index start |
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, dealias, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tojstring, tolong, toshort, toString, touserdata, touserdata, typepublic boolean isTailcall()
VarargsisTailcall 在类中 Varargspublic LuaValue arg(int i)
Varargsarg 在类中 Varargsi - the index of the argument to get, 1 is the first argumentVarargs.arg1(),
LuaValue.NILpublic LuaValue arg1()
Varargsarg1 在类中 VarargsVarargs.arg(int),
LuaValue.NILpublic int narg()
VarargsCopyright © 2020. All rights reserved.