klyn.Application.eval
method
public static native eval(code as String) as Object throws SyntaxError, TypeError, Exception
Description

Compiles and executes a Klyn script provided as a string. The supplied String is executed as-is, without additional reindentation. Triple-quoted literals remove their common margin when the String is created.

Parameters
ParameterDescription
codeKlyn source code to compile and execute.
Throws
  • SyntaxError if the code contains a syntax error.
  • TypeError if the code contains a type error.
  • Exception if compilation or execution fails.
Example
result = Application.eval("40 + 2")
print(result)