Interpreter

trait Interpreter extends Interpreter with Model[Update]
Companion
object
trait Model[Update]
trait Interpreter
class Object
trait Matchable
class Any

Value members

Inherited methods

def addListener(pf: Listener[Update]): pf

Registers a listener for updates from the model. A listener is simply a partial function which receives instances of U. Therefore the listener can decide with pattern match cases which updates it wants to handle.

Registers a listener for updates from the model. A listener is simply a partial function which receives instances of U. Therefore the listener can decide with pattern match cases which updates it wants to handle.

Example:

 m.addListener {
   case NcviewSync.Open(path) => ...
 }

Note: If the listener should be removed at some point, it is important to store it somewhere:

 val l: NcviewSync.Listener = { case NcviewSync.Open(path) => ... }
 m.addListener(l)
 ...
 m.removeListener(l)
Inherited from
Model
def completer: Completer

A code completion component which may be attached to an editor.

A code completion component which may be attached to an editor.

Inherited from
Interpreter
def interpret(code: String, quiet: Boolean): Result

Interprets a piece of code. Unlike interpret the result is not evaluated. That is, in the case off Success the result value will always be ().

Interprets a piece of code. Unlike interpret the result is not evaluated. That is, in the case off Success the result value will always be ().

Inherited from
Interpreter
def interpretWithResult(code: String, quiet: Boolean): Result

Interprets a piece of code

Interprets a piece of code

Value Params
code

the source code to interpret

quiet

whether to suppress result printing (true) or not (false)

Returns

the result of the execution of the interpreted code

Inherited from
Interpreter
def removeListener(pf: Listener[Update]): Unit

Un-registers a listener for updates from the model.

Un-registers a listener for updates from the model.

Inherited from
Model