evaluate
fun PolyglotContext.evaluate(language: GuestLanguage, source: String, name: String? = null, internals: Boolean = false, interactive: Boolean = PolyglotDefaults.DEFAULT_INTERACTIVE, cached: Boolean = PolyglotDefaults.DEFAULT_CACHED, uri: URI? = null): PolyglotValue
Evaluate a fragment of source code in the specified language, returning the result of the execution. Depending on the configuration of the context, this method may fail if the language is not enabled in the underlying engine.
Return
The result of evaluating the source.
Parameters
name
Name for this source fragment.
language
The language of the source code.
source
The guest code to be executed.
internals
Indicates that the source in question is "internal."
interactive
Whether this script should run interactively; defaults to false
.
cached
Whether to allow source-base caching; defaults to true
.
uri
Addressable URI to this source code; defaults to null
. Generated on-the-fly if not provided.