Lua.VM.Display.Closure (Lua v1.0.0-rc.0)
View SourceDisplay wrapper for a Lua closure ({:lua_closure, proto, upvalues})
returned across the Lua.eval!/2 boundary.
Carries the closure's source, line, and arity for human display.
The wrap fires in both decode: true and decode: false modes
because raw closure tuples have always leaked to the user.
Fields
:source— source name attached to the closure's prototype (for example"<eval>"or"my_script.lua").:line— first line of the closure's body, derived from the prototype's:linesfield.:arity— the number of declared parameters. Variadic closures have:arityequal to the fixed-parameter count; the variadic flag is reflected by appending+...in the inspect output.:vararg?— true when the closure accepts varargs (...).:ref— the original{:lua_closure, proto, upvalues}tuple so callers can still reach the live closure (for example viaLua.call_function/3).
Internal pattern matches against {:lua_closure, _, _} are
unaffected; the wrap is a display affordance applied at the eval
boundary only.
Summary
Types
@type t() :: %Lua.VM.Display.Closure{ arity: non_neg_integer(), line: non_neg_integer(), ref: tuple(), source: binary(), vararg?: boolean() }