Download Slideshow: Functional Presentations

Transcript
Slideshow: Functional Presentations
31
Fig. 2. Picts in DrScheme’s REPL
programming tools work as usual, including the on-the-fly syntax colorer, the syntax checker,
the debugger, and the static analyzer. Non-textual syntax can be used in a Slideshow program, such as a test-case boxes, comment boxes, or XML boxes (which support literal
XML without concern for escape characters) (Clements et al., 2004). More importantly,
we can use DrScheme’s extension interface to add new tools to DrScheme that specifically
support slide creation.
6.1 REPL Picts
To better support interactive development, DrScheme’s read-eval-print-loop (REPL) prints
picts as they are drawn in a slide. Figure 2 shows a call to main-characters and the
resulting pict.
Each pict result in DrScheme’s REPL is itself interactive. When the programmer moves
the mouse pointer over a pict, DrScheme shows sub-pict bounding boxes that enclose the
pointer. In the figure, the narrow bounding box corresponds to the blue fish under the
pointer, and the wide bounding box corresponds to an intermediate pict from hc-append.
By default, DrScheme does not show bounding boxes that contain other bounding boxes
around the pointer (so the visible bounding boxes are minimal), but pressing the Alt (or
Meta) key exposes all of the bounding boxes that enclose the pointer. Pressing the Control
key shows all bounding boxes in the entire pict. Pressing the Shift key toggles the color of
each bounding box between black and white.
6.2 Tracing Picts
Figure 3 shows a screen dump for another tool. This tool records all picts that are generated
during the run of a Slideshow program. It then highlights each expression that produced