setReader(object, reader = standardReader, onQuit = NULL, con = as(object, "connection")) setMonitor(timeout, action, onQuit = NULL)
evalParse
. As its name suggests, this function parses
one S expression from the connection and evaluates the result. This is similar to
what happens with user expressions on standard input, except that there is no automatic
printing. If you want an additional reader that behaves exactly as the standard
S evaluation of tasks (including automatically showing the result of the evaluation,
supply
standardReader
as the
reader
argument.
action
function
should be to call
resetMonitor()
with an optional argument of the new
timeout
(by default the value given to
setMonitor()
is
used).
These functions modify S event management. The standard S user interface runs an unending loop looking for outstanding events. An event is signalled if there is input waiting on one of the designated readers or if one of the monitors has timed out. When the S process starts up, a reader is established on standard input. Other readers or monitors may be established. Once a reader or monitor is established, the system looks for corresponding events.
Monitor events can also be checked within the evaluation of an expression; the actions
triggered this way are subevents within the current task. Actions for subevents
should be simple, if they are to be re-run with a small
timeout
value;
otherwise, they threaten to eat up much the computing time. To turn sub-event monitoring
on and off, use
setSubEvent()
.
These functions do not work on GUI versions of S-PLUS, and are not recommended for general use.
## arrange to run a number of S test files through the do.test ## function, each file as a separate task ## The function is defined inline in the setReader() call setReader(textConnection(filenames), function(con) do.test(pread(con, n=1)))