capture

Group: closures

Captures a reference to a value for use inside a closure. References are transparent to user-code, and are automatically resolved by the runtime. Using references implies a switch from scope-based resource management into reference-counting scheme; the switch is done on a per-value basis.

Syntax

    (0)     capture affected-closure:r-op target-register-inside-closure:index source:r-op
    

Examples

.function: example/0
    return
.end
    

Related instructions

capturecopy, capturemove, closure.