demoSource-class {SoDA} | R Documentation |
Objects from this class are created and manipulated during interactive sessions with the demoSource()
function. They
Objects can be created by calls of the form new("demoSource", ...)
.
Generally, objects are created by demoSource()
and
modified by the various utility functions that process control and
demo input. Objects from the class are normally used to save and
restart an incomplete demo.
lines
:"character"
holding the lines of the source connection. pos
:partial
:expr
:value
:envir
:"environment"
, the environment in which expressions have been evaluated.state
:"partial"
, "parsed"
, and "evaluated"
correspond having read some (or all) of the current input, to having parsed that (and determined that it's a complete expression), and having evaluated the expression.
See demoSource()
for how one gets to these states; for example, the typical ""
control input first reads and parses to a complete expression, and then on the next such input evaluates.
The various utility functions used by demoSource()
modify the demo object they receive to reflect the step(s) taken, and then return the modified object. The call to demoSource()
itself returns (invisibly) the demo object as it stands when the demo exits. Using the returned object, one can pause and resume a demo or interleave multiple demos.