Skip to content

Bytecode

Decoded and verified Do bytecode, produced by load.

It runs at most once.

Methods

run … -> Value

Executes the bytecode, as run does.

Parameters

NameTypeDescription
:importer? ((Str, <Value, >Value) -> Value) Program-specific module importer, called with the requested module name. Input ends immediately and output is discarded while the importer runs.
< Iter[Value]
> Sink[Value]

Returns

The result of executing the bytecode.

Errors

StateError if the bytecode has already run.

Example

let program = load $ (compile.compile "example.dol" "(1 + 1)").emit()
assert_eq $program.run() 2