evaluate

abstract fun evaluate(source: Source, options: PolyglotContext.EvaluationOptions): PolyglotValue

Evaluate the given source, returning the result of the execution. Depending on the configuration of the context, this method may fail if the selected language is not enabled in the underlying engine.

This is the main variant that implementors are expected to provide; the enclosed options should carry all defaults as well as user overrides.

Return

The result of evaluating the source.

Parameters

source

The guest code to be executed.

options

Full suite of options applying to this evaluation, with defaults filled in, as applicable.


open fun evaluate(source: Source, internals: Boolean): PolyglotValue

Evaluate the given source, returning the result of the execution. Depending on the configuration of the context, this method may fail if the selected language is not enabled in the underlying engine.

NOTE: This method merely prepares EvaluationOptions accordingly, and then dispatches to the main variant of evaluate.

Return

The result of evaluating the source.

Parameters

source

The guest code to be executed.

internals

Whether to allow access to internal runtime features; the provided source must be marked as internal to enable this access.


open fun evaluate(source: Source): PolyglotValue

Evaluate the given source, returning the result of the execution. Depending on the configuration of the context, this method may fail if the selected language is not enabled in the underlying engine.

NOTE: This method does not specify any additional access grants or other options for the evaluation cycle; see EvaluationOptions and other variants of evaluate for more information.

Return

The result of evaluating the source.

Parameters

source

The guest code to be executed.