Context

Context represents an internal state in Pnuts runtime environment. A Context object contains the following information.

A pnuts.lang.Context object represents a context. See "Pnuts API Overview" for details.

getContext()

getContext() refers to the currently executing context, which is created when an interactive session starts or load() or loadFile() is called. All other executions refer to the current context.

eval(expression)
eval(expression, package)
eval(expression, context)

eval() can have a context as a parameter.

Where user message is shown

For each context the following can be specified.

context . getOutputStream ()
context . setOutputStream (anOutputStream or aWriter)
context . getErrorStream ()
context . setErrorStream (anOutputStream or aWriter)
context . getTerminalStream ()
context . setTerminalStream (anOutputStream or aWriter)

Back