execute

open fun execute(handle: Any, code: String, out: Capture): Any

Run a handle from compile and return an exec.Outcome (result text + isError) or, if the snippet's value was a stdlib iterator { ... yield() ... }, an exec.IterEval for the lane to drive one step per tick.

Return

an exec.Outcome, or an exec.IterEval for a cross-tick iterator snippet

Parameters

handle

a handle from compile

code

the original source, so compile diagnostics can echo the offending line

out

the sink the snippet's println writes to; the caller owns it, so a kill, cancel or timeout can still report what was printed before the eval ended