Package com.prineside.luaj
Class TailcallVarargs
java.lang.Object
com.prineside.luaj.Varargs
com.prineside.luaj.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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTailcallVarargs(LuaValue object, LuaValue methodname, Varargs args) TailcallVarargs(LuaValue f, Varargs args) -
Method Summary
Modifier and TypeMethodDescriptionarg(int i) Get the n-th argument value (1-based).arg1()Get the first argument in the list.eval()Evaluate any pending tail call and return result.booleanReturn true if this is a TailcallVarargsintnarg()Get the number of arguments, or 0 if there are none.subargs(int start) Create aVarargsinstance containing arguments starting at indexstartMethods inherited from class com.prineside.luaj.Varargs
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, type
-
Constructor Details
-
TailcallVarargs
-
TailcallVarargs
-
-
Method Details
-
isTailcall
public boolean isTailcall()Description copied from class:VarargsReturn true if this is a TailcallVarargs- Overrides:
isTailcallin classVarargs- Returns:
- true if a tail call, false otherwise
-
eval
Description copied from class:VarargsEvaluate any pending tail call and return result. -
arg
Description copied from class:VarargsGet the n-th argument value (1-based). -
arg1
Description copied from class:VarargsGet the first argument in the list. -
narg
public int narg()Description copied from class:VarargsGet the number of arguments, or 0 if there are none. -
subargs
Description copied from class:VarargsCreate aVarargsinstance containing arguments starting at indexstart
-