eval

Evaluates Kotlin code and returns its result.

Variables added with add are bound first, including any added after an earlier evaluation.

Return

the value of the last expression, or null

Parameters

code

the Kotlin source code to evaluate

Throws

if code contains a literal JVM-termination call, or fails to compile or run