redStart {redcas}R Documentation

function to start a REDUCE session

Description

Starts a REDUCE session using a pipe connection sending the output (log) to a temporary file.

Usage

redStart(dialect = "csl", dirpath, options, echo=FALSE)

Arguments

dialect

character. The version of lisp with which the REDUCE executable was built. Allowed values are csl, the default, or psl.

dirpath

character. Path to a directory containing the REDUCE executables. Optional, see details below.

options

character. Options for the csl version. See details.

echo

boolean. Should the ECHO switch be turned on. Default is FALSE to match the REDUCE default.

Details

redcas finds the REDUCE executables in two different ways. The first is the explicit specification of the path using the dirpath argument passed to the redStart function. If this does not contain the REDUCE executable, redStart stops executing on the assumption that a specific version was intended.

The second method is used if dirpath is not specified. This determines the path at package load time by searching the following three locations in turn until the executable is found:

This approach provides the flexibility to have a default version while being able to call different versions explicitly.

While it is possible to start a second REDUCE session without closing the first, garbage collection closes its connection. A future release will fix this issue.

redStart carries out the following actions:

Value

The session identifier which is an integer >0 if the session started successfully. If the session could not be started, redStart terminates using stop. If no REDUCE executable was found returns FALSE.

Author(s)

martin gregory

See Also

showSessions to list active sessions and redClose for closing a session.

Examples

## Open a CSL session:
id1 <- redStart()
## can only run code if session was successfully started
if (is.numeric(id1)) {
   ## show session details:
   print(showSessions())
   ## close session:
   redClose(id1)
}

[Package redcas version 0.1.1 Index]