Interactive Evaluation in Slideshow
(require slideshow/repl) | package: slideshow-repl |
procedure
(repl-area [ #:width width #:height height #:font-size font-size #:background background #:prompt prompt-str #:make-namespace make-namespace] content ...) → pict? width : real? = (* client-w 2/3) height : real? = (* client-h 1/4) font-size : (or/c #f (integer-in 1 1024)) = #f background : (or/c #f (is-a?/c color%) string?) = #f prompt-str : string? = "> " make-namespace : (-> namespace?) = make-base-namespace content : string?
The width and height arguments determine the size of the resulting pict.
If font-size is not #f, then it determines a font size used, but with the constraint that all slideshow/repl-based picts that appear on the slide will use the same font size (so all such picts should specify a consistent size, or else an unspecified pict’s size is used).
When background is not #f, it determines a background for the area.
The prompt-str determines a prompt that is show for input expressions in the interactive-evaluation area.
The make-namespace argument determines the namespace (created once) for evaluation.
The content strings, if any, are inserted into the evaluation area after the prompt, with a newline between each content string.
procedure
(make-repl-group [ #:log-file log-file #:prompt prompt-str #:make-namespace make-namespace]) → repl-group? log-file : path-string? = "eval-log.rktl" prompt-str : (or/c #f string?) = #f make-namespace : (-> namespace?) = make-base-namespace
When a module area’s content is evaluated, the content of the module is recorded to log-file.
The prompt-str argument determines the prompt that is shown in an result area. If it is not #f, then he result area supports interactive evaluation in the same way as repl-area.
The make-namespace argument determines the namespace for evaluation. A fresh namespace is created using make-namespace on each evaluation triggered for a module in the group.
procedure
(repl-group? v) → boolean?
v : any/c
procedure
(result-area group [ #:width width #:height height #:background background #:font-size font-size] content ...) → pict? group : repl-group? width : real? = (* client-w 2/3) height : real? = (* client-h 1/4) background : (or/c (is-a?/c color%) string?) = "white" font-size : (or/c #f (integer-in 1 1024)) = #f content : string?
Multiple result areas created for a group display the same interaction content.
procedure
(make-module-backing group [ #:module-name module-name] content-line ...) → module-backing? group : repl-group? module-name : path-string? = "program.rkt" content-line : string?
When the module is evaluated, a require of each can use one of the other modules in the group by using the other’s module’s module-name.
Multiple modules areas created with module-area can share a backing, so that they provide the same view on the underlying content. For example, a narrow view on one slide might be replaced by a wider view on another side with the same module backing, so that edits via the first are preserved in the second area’s display.
procedure
(module-backing? v) → boolean?
v : any/c
procedure
(module-area backing [ #:width width #:height height #:background background #:font-size font-size #:auto-eval? auto-eval?]) → pict? backing : module-backing? width : real? = (* client-w 1/4) height : real? = (* client-h 1/4) background : (or/c (is-a?/c color%) string?) = "white" font-size : (or/c #f (integer-in 1 1024)) = #f auto-eval? : any/c = #f
When the keyboard focus in the area, typing F5 requires the module. Typing F6 requires the module’s test submodule.
procedure
(module-backing-module-name backing) → path-string?
backing : module-backing?