-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
local fn_info = debug.getinfo(fn, 's')
fn_info.source --=> @.repl.lua
fn_info.linedefined --=> 6
fn_info.lastlinedefined --=> 8
fn_info.nparams --=> 2
fn_info.isvararg --=> false
fn_info.nups --=> 1
This allows us to add support for functions defined outside of stdin. For a
REPL usecase, this means sending loadfile(<file>)() to the REPL instead of
the lines themselves.
nups ("number of upvalues") can be used to see if the function requires a closure.
With this information we can support functions that:
- Do not require closures (i.e.
nups == 0) - Are defined somewhere other than stdin
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels