Application
classin packageklyn
public class Application:
Application
Global runtime entry point exposed by default in every Klyn program. Static members can be used with or without the `Application.` prefix.
Application.print( "ok" )
print( "ok" )
Fields
Modifier and Type Member Description
public static readonly EXIT_FAILURE
EXIT_FAILURE as Int = -1
Conventional failure exit code (`-1`).
public static readonly EXIT_SUCCESS
EXIT_SUCCESS as Int = 0
Conventional success exit code (`0`).
public static native arguments
arguments as List<String>
Command-line arguments passed to the program.
public static native environmentVariables
environmentVariables as Map<String, String>
Environment variables of the current process.
public static native readonly err
err as TextWriter
Standard error stream of the process.
public static native readonly in Standard input stream of the process.
public static native readonly out
out as TextWriter
Standard output stream of the process.
public static native readonly pid
pid as UInt
Process identifier of the current runtime.
public static native properties
properties as Map<String, String>
System properties exposed by the runtime.
Properties
Modifier and Type Member Description
public static readonly property classLoader
classLoader as SystemClassLoader:
Returns the runtime system class loader.
Methods
Modifier and Type Member Description
public static native compile
compile(code as String) throws SyntaxError, TypeError, Exception
Compiles a Klyn script provided as a string.
public static native currentTimeMillis
currentTimeMillis() as ULong
Returns the current time in milliseconds since the Unix epoch.
public static native eval
eval(code as String) throws SyntaxError, TypeError, Exception
Compiles and executes a Klyn script provided as a string.
public static native exit
exit(exitCode as Int)
Terminates the current process.
public static native input
input(prompt as String, inputStream as TextReader) as String
Reads a line from the given input stream, after optionally printing a prompt.
public static native print
print(values... as Object, sep as String, end as String, output as TextWriter)
Prints one or more values to the given output stream.
public static sum
sum<T>(values as IList<T>) as T:
Returns the sum of all numeric values from a read-only list.
public static sum
sum<T>(values as Set<T>) as T:
Returns the sum of all numeric values from a set.
public static sum
sum<T>(values as klyn.math.NDArray<T>) as T:
Returns the sum of all numeric values from an NDArray.
public static native type
type(value as Object) as Type
Returns the runtime type of a value.