Module SCL/CommandSession

This module is undocumented. This is a list of its definitions.

create :: ModuleRepository -> <Proc> CommandSession

Creates a command session that compiles its commands in the given module repository. A new session starts with Builtin and StandardLibrary imported without a prefix.

execute :: CommandSession -> String -> <Proc> ()

Compiles and runs the given command text in the session, updating the session's variables and imports as the command does. Compilation errors and exceptions thrown by the command are printed to the session's reporting handler instead of being thrown, so this itself does not fail.

executeThrowing :: CommandSession -> String -> <Proc> ()

Compiles and runs the given command text in the session like execute, but rethrows the failures that execute only prints to the session's reporting handler: compilation errors, syntax errors and exceptions raised by the commands themselves. The diagnostics are still printed before the failure is rethrown. An explicit cancellation of the execution is not a failure, and an interruption is rethrown as an InterruptedException.

get :: CommandSession -> String -> <Proc> Maybe SafeDynamic

The value and type of the session variable with the given name, or Nothing if the session has no variable by that name.

remove :: CommandSession -> String -> <Proc> ()

Removes the session variable with the given name. Does nothing if there is no such variable.

set :: CommandSession -> String -> SafeDynamic -> <Proc> ()

Sets the session variable with the given name to the given value and type, replacing any earlier variable by that name.