ref::construct()
The constructor. Create an instance of class ref and store address of a function. To call the function, use function call() or eval()
ref::construct(fn)
fn (ref|function_call) — Function to be stored its address
ref — Returns the instance of class ref
f = ref(some_func())
call(f, 4)
function some_func(x)
writeln(x ^ 2)
stop
' Output:
' 16