diff --git a/collects/2htdp/universe.rkt b/collects/2htdp/universe.rkt index 03ca287b99..80ec05b9d5 100644 --- a/collects/2htdp/universe.rkt +++ b/collects/2htdp/universe.rkt @@ -152,7 +152,8 @@ (provide-primitives make-package ;; World Sexp -> Package package? ;; Any -> Boolean - run-movie ;; [Listof Image] -> true + run-movie ;; [r Positive] [m [Listof Image]] -> true + ;; run movie m at rate r images per second mouse-event? ;; Any -> Boolean : MOUSE-EVTS mouse=? ;; MOUSE-EVTS MOUSE-EVTS -> Boolean key-event? ;; Any -> Boolean : KEY-EVTS diff --git a/collects/teachpack/2htdp/scribblings/batch-io.scrbl b/collects/teachpack/2htdp/scribblings/batch-io.scrbl index c1cd62fe9b..bdb42356d8 100644 --- a/collects/teachpack/2htdp/scribblings/batch-io.scrbl +++ b/collects/teachpack/2htdp/scribblings/batch-io.scrbl @@ -148,3 +148,10 @@ There is only one writer function at the moment: (with-handlers ([exn:fail:filesystem? void]) (delete-file "output.txt"))) +@section{Testing} + +@defform[(simulate-file process str ...)]{ + simulates a file system for the function @scheme[process], which reads a + file and may produce one. Note: this form is under development and will be + documented in a precise manner after it is finalized and useful for a wide + audience.} diff --git a/collects/teachpack/2htdp/scribblings/universe.scrbl b/collects/teachpack/2htdp/scribblings/universe.scrbl index 3e1493215c..43a3457199 100644 --- a/collects/teachpack/2htdp/scribblings/universe.scrbl +++ b/collects/teachpack/2htdp/scribblings/universe.scrbl @@ -25,7 +25,7 @@ @author{Matthias Felleisen} -@defmodule[#:require-form beginner-require 2htdp/universe #:use-sources (teachpack/htdp/image)] +@defmodule[#:require-form beginner-require 2htdp/universe #:use-sources (teachpack/2htdp/image)] @;{FIXME: the following paragraph uses `defterm' instead of `deftech', because the words "world" and "universe" are used as datatypes, and @@ -106,6 +106,13 @@ Example: @scheme[animate] was originally called @scheme[run-simulation], and this binding is retained for backwards compatibility} +@defproc[(run-movie [r (and/c real? positive?)] [m [Listof image?]]) + true]{ + + @scheme[run-movie] displays the list of images @scheme[m] at the rate of + @scheme[r] images per second.} + + @;----------------------------------------------------------------------------- @section[#:tag "interactive"]{Interactions} diff --git a/collects/teachpack/htdp/scribblings/arrow-gui.scrbl b/collects/teachpack/htdp/scribblings/arrow-gui.scrbl index f2e1ac4739..0a1a1d330b 100644 --- a/collects/teachpack/htdp/scribblings/arrow-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/arrow-gui.scrbl @@ -6,7 +6,7 @@ @teachpack["arrow-gui"]{An Arrow GUI} -@declare-exporting[teachpack/htdp/arrow-gui] +@defmodule[#:require-form beginner-require htdp/arrow-gui] The teachpack provides operations for creating and manipulating an arrow GUI. We recommend using the @seclink["world"]{world teachpack} instead. diff --git a/collects/teachpack/htdp/scribblings/arrow.scrbl b/collects/teachpack/htdp/scribblings/arrow.scrbl index 6f2ceb102b..9f0e6ea497 100644 --- a/collects/teachpack/htdp/scribblings/arrow.scrbl +++ b/collects/teachpack/htdp/scribblings/arrow.scrbl @@ -6,7 +6,8 @@ @teachpack["arrow"]{Managing Control Arrows} -@declare-exporting[teachpack/htdp/arrow] +@;declare-exporting[teachpack/htdp/arrow] +@defmodule[#:require-form beginner-require htdp/arrow] The teachpack implements a controller for moving shapes across a canvass. A shape is a class of data for which @scheme[move] and @scheme[draw] diff --git a/collects/teachpack/htdp/scribblings/convert.scrbl b/collects/teachpack/htdp/scribblings/convert.scrbl index 123dd2e2e0..a1d2b4a525 100644 --- a/collects/teachpack/htdp/scribblings/convert.scrbl +++ b/collects/teachpack/htdp/scribblings/convert.scrbl @@ -6,7 +6,8 @@ @teachpack["convert"]{Converting Temperatures} -@declare-exporting[teachpack/htdp/convert] +@;declare-exporting[teachpack/htdp/convert] +@defmodule[#:require-form beginner-require htdp/convert] The teachpack @scheme[convert.ss] provides three functions for converting Fahrenheit temperatures to Celsius. It is useful for a single diff --git a/collects/teachpack/htdp/scribblings/dir.scrbl b/collects/teachpack/htdp/scribblings/dir.scrbl index a106dd670e..ed57a0dc82 100644 --- a/collects/teachpack/htdp/scribblings/dir.scrbl +++ b/collects/teachpack/htdp/scribblings/dir.scrbl @@ -7,7 +7,8 @@ @teachpack["dir"]{Working with Files and Directories} -@declare-exporting[teachpack/htdp/dir] +@;declare-exporting[teachpack/htdp/dir] +@defmodule[#:require-form beginner-require htdp/dir] The teachpack provides structures and operations for working with files and directories: diff --git a/collects/teachpack/htdp/scribblings/docs.scrbl b/collects/teachpack/htdp/scribblings/docs.scrbl index a992d7d12c..74e771c0dd 100644 --- a/collects/teachpack/htdp/scribblings/docs.scrbl +++ b/collects/teachpack/htdp/scribblings/docs.scrbl @@ -6,7 +6,8 @@ @teachpack["docs"]{Manipulating Simple HTML Documents} -@declare-exporting[teachpack/htdp/docs] +@;declare-exporting[teachpack/htdp/docs] +@defmodule[#:require-form beginner-require htdp/docs] The teachpack provides three operations for creating simple ``HTML'' documents: diff --git a/collects/teachpack/htdp/scribblings/draw.scrbl b/collects/teachpack/htdp/scribblings/draw.scrbl index ba2328dc45..afab9bc46f 100644 --- a/collects/teachpack/htdp/scribblings/draw.scrbl +++ b/collects/teachpack/htdp/scribblings/draw.scrbl @@ -6,7 +6,8 @@ @teachpack["draw"]{Simple Drawing} -@declare-exporting[teachpack/htdp/draw] +@;declare-exporting[teachpack/htdp/draw] +@defmodule[#:require-form beginner-require htdp/draw] The teachpack provides two sets of functions: one for drawing into a canvas and one for reacting to canvas events. diff --git a/collects/teachpack/htdp/scribblings/elevator.scrbl b/collects/teachpack/htdp/scribblings/elevator.scrbl index c188d33b42..40a36dc008 100644 --- a/collects/teachpack/htdp/scribblings/elevator.scrbl +++ b/collects/teachpack/htdp/scribblings/elevator.scrbl @@ -6,7 +6,8 @@ @teachpack["elevator"]{Controlling an Elevator} -@declare-exporting[teachpack/htdp/elevator] +@;declare-exporting[teachpack/htdp/elevator] +@defmodule[#:require-form beginner-require htdp/elevator] The teachpack implements an elevator simulator. diff --git a/collects/teachpack/htdp/scribblings/graphing.scrbl b/collects/teachpack/htdp/scribblings/graphing.scrbl index 093a0d2ceb..d4bb711d97 100644 --- a/collects/teachpack/htdp/scribblings/graphing.scrbl +++ b/collects/teachpack/htdp/scribblings/graphing.scrbl @@ -6,7 +6,8 @@ @teachpack["graphing"]{Graphing Functions} -@declare-exporting[teachpack/htdp/graphing] +@;declare-exporting[teachpack/htdp/graphing] +@defmodule[#:require-form beginner-require htdp/graphing] The teachpack provides two operations for graphing functions in the regular (upper right) quadrant of the Cartesian plane (between 0 and 10 in both diff --git a/collects/teachpack/htdp/scribblings/guess.scrbl b/collects/teachpack/htdp/scribblings/guess.scrbl index e21bbff722..00e7b12ba8 100644 --- a/collects/teachpack/htdp/scribblings/guess.scrbl +++ b/collects/teachpack/htdp/scribblings/guess.scrbl @@ -6,7 +6,8 @@ @teachpack["guess"]{Guessing Numbers} -@declare-exporting[teachpack/htdp/guess] +@;declare-exporting[teachpack/htdp/guess] +@defmodule[#:require-form beginner-require htdp/guess] The teachpack provides operations to play a guess-the-number game. Each operation display a GUI in which a player can choose specific values for diff --git a/collects/teachpack/htdp/scribblings/gui.scrbl b/collects/teachpack/htdp/scribblings/gui.scrbl index c0ed6b0148..0ec38b750f 100644 --- a/collects/teachpack/htdp/scribblings/gui.scrbl +++ b/collects/teachpack/htdp/scribblings/gui.scrbl @@ -6,7 +6,8 @@ @teachpack["gui"]{Simple Graphical User Interfaces} -@declare-exporting[teachpack/htdp/gui] +@;declare-exporting[teachpack/htdp/gui] +@defmodule[#:require-form beginner-require htdp/gui] The teachpack provides operations for creating and manipulating graphical user interfaces. We recommend using the @seclink["world"]{world teachpack} diff --git a/collects/teachpack/htdp/scribblings/hangman.scrbl b/collects/teachpack/htdp/scribblings/hangman.scrbl index 4741585053..c00ebd411d 100644 --- a/collects/teachpack/htdp/scribblings/hangman.scrbl +++ b/collects/teachpack/htdp/scribblings/hangman.scrbl @@ -6,7 +6,8 @@ @teachpack["hangman"]{Hangman} -@declare-exporting[teachpack/htdp/hangman] +@;declare-exporting[teachpack/htdp/hangman] +@defmodule[#:require-form beginner-require htdp/hangman] The teachpack implements the callback functions for playing a @emph{Hangman} game, based on a function designed by a student. The player diff --git a/collects/teachpack/htdp/scribblings/master.scrbl b/collects/teachpack/htdp/scribblings/master.scrbl index 4a67dceeef..59d442b3ff 100644 --- a/collects/teachpack/htdp/scribblings/master.scrbl +++ b/collects/teachpack/htdp/scribblings/master.scrbl @@ -6,7 +6,8 @@ @teachpack["master"]{MasterMinding} -@declare-exporting[teachpack/htdp/master] +@;declare-exporting[teachpack/htdp/master] +@defmodule[#:require-form beginner-require htdp/master] The teachpack implements GUI for playing a simple master mind-like game, based on a function designed by a student. The player clicks on two colors diff --git a/collects/teachpack/htdp/scribblings/matrix.scrbl b/collects/teachpack/htdp/scribblings/matrix.scrbl index af5a1a9659..842eba6cc0 100644 --- a/collects/teachpack/htdp/scribblings/matrix.scrbl +++ b/collects/teachpack/htdp/scribblings/matrix.scrbl @@ -7,6 +7,9 @@ @teachpack["matrix"]{Matrix Operations} +@;declare-exporting[teachpack/htdp/matrix] +@defmodule[#:require-form beginner-require htdp/matrix] + The experimental teachpack supports matrices and matrix operations. A matrix is just a rectangle of 'objects'. It is displayed as an image, just like the images from @secref["image"]. Matrices are images and, indeed, @@ -20,8 +23,6 @@ row first, column second. The operations aren't tuned for efficiency so don't expect to build programs that process lots of data. -@declare-exporting[teachpack/htdp/matrix] - @deftech{Rectangle} A Rectangle (of X) is a non-empty list of lists containing X where all elements of the list are lists of equal (non-zero) length. diff --git a/collects/teachpack/htdp/scribblings/show-queen.scrbl b/collects/teachpack/htdp/scribblings/show-queen.scrbl index c6ef0f7314..13c07e8f51 100644 --- a/collects/teachpack/htdp/scribblings/show-queen.scrbl +++ b/collects/teachpack/htdp/scribblings/show-queen.scrbl @@ -6,7 +6,8 @@ @teachpack["show-queen"]{Queens} -@declare-exporting[teachpack/htdp/show-queen] +@;declare-exporting[teachpack/htdp/show-queen] +@defmodule[#:require-form beginner-require htdp/show-queen] The teachpack provides the operation @scheme[show-queen], which implements a GUI for exploring the n-queens problem. diff --git a/collects/teachpack/htdp/scribblings/world.scrbl b/collects/teachpack/htdp/scribblings/world.scrbl index aec7894c19..d1204cd04e 100644 --- a/collects/teachpack/htdp/scribblings/world.scrbl +++ b/collects/teachpack/htdp/scribblings/world.scrbl @@ -45,6 +45,12 @@ second one generalizes the first by adding interactive GUI features. @; ----------------------------------------------------------------------------- @section[#:tag "simulations"]{Simple Simulations} +@defproc[(run-movie [r (and/c real? positive?)] [m [Listof image?]]) + true]{ + + @scheme[run-movie] displays the list of images @scheme[m] at the rate of + @scheme[r] images per second.} + @defproc[(run-simulation [w natural-number/c] [h natural-number/c]