demoSourceClass: Class "demoSource" for objects used with demoSource()...

Description Objects from the Class Slots See Also


Objects from this class are created and manipulated during interactive sessions with the demoSource() function. They

Objects from the Class

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.



Object of class "character" holding the lines of the source connection.


Current position in the source buffer (the number of lines that have been processed so far).


While an expression is being parsed, lines in the current expression are copied here.


When an expression has been parsed, the parsed expression is stored here.


When an expression has been evaluated, the value is stored here.


Object of class "environment", the environment in which expressions have been evaluated.


Character string used to indicate the current state of the demo. States "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.

See Also


SoDA documentation built on Oct. 28, 2020, 9:07 a.m.