|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.luaj.vm2.Varargs org.luaj.vm2.TailcallVarargs
public class TailcallVarargs
Subclass of 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.
Prototype
,
LuaJC
Constructor Summary | |
---|---|
TailcallVarargs(LuaValue object,
LuaValue methodname,
Varargs args)
|
|
TailcallVarargs(LuaValue f,
Varargs args)
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.luaj.vm2.Varargs |
---|
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tojstring, tolong, toshort, toString, touserdata, touserdata, type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TailcallVarargs(LuaValue f, Varargs args)
public TailcallVarargs(LuaValue object, LuaValue methodname, Varargs args)
Method Detail |
---|
public boolean isTailcall()
Varargs
isTailcall
in class Varargs
public Varargs eval()
Varargs
eval
in class Varargs
public LuaValue arg(int i)
Varargs
arg
in class Varargs
i
- the index of the argument to get, 1 is the first argument
Varargs.arg1()
,
LuaValue.NIL
public LuaValue arg1()
Varargs
arg1
in class Varargs
Varargs.arg(int)
,
LuaValue.NIL
public int narg()
Varargs
narg
in class Varargs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |