diff --git a/collects/scribblings/htdp-langs/htdp-langs.scrbl b/collects/scribblings/htdp-langs/htdp-langs.scrbl index 599452ccb4..2e3131b163 100644 --- a/collects/scribblings/htdp-langs/htdp-langs.scrbl +++ b/collects/scribblings/htdp-langs/htdp-langs.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.rkt" (for-label lang/htdp-beginner)) -@title{@italic{How to Design Programs} Languages} +@title[#:tag "top"]{@italic{How to Design Programs} Languages} The languages documented in this manual are provided by DrRacket to be used with the @italic{@link["http://www.htdp.org/"]{How to Design diff --git a/collects/scribblings/htdp-langs/intermediate-lambda.scrbl b/collects/scribblings/htdp-langs/intermediate-lambda.scrbl index 0df50022b9..aea5943abf 100644 --- a/collects/scribblings/htdp-langs/intermediate-lambda.scrbl +++ b/collects/scribblings/htdp-langs/intermediate-lambda.scrbl @@ -40,14 +40,14 @@ character] ] -@prim-nonterms[("intermediate-w-lambda") define define-struct] +@prim-nonterms[("intm-w-lambda") define define-struct] -@prim-variables[("intermedia-w-lambda") empty true false] +@prim-variables[("intm-w-lambda") empty true false] @; ---------------------------------------------------------------------- -@section[#:tag "intermediate-lambda-syntax"]{Syntax for Intermediate with Lambda} +@section[#:tag "intm-w-lambda-syntax"]{Syntax for Intermediate with Lambda} @defform[(lambda (variable variable ...) expression)]{ @@ -90,7 +90,7 @@ the function.} @; ---------------------------------------------------------------------- -@section[#:tag "intermediate-lambda-common-syntax"]{Common Syntax} +@section[#:tag "intm-w-lambda-common-syntax"]{Common Syntax} @(define-forms/normal define) @@ -111,7 +111,7 @@ the function.} check-range require) -@section[#:tag "intermediate-lambda-pre-defined"]{Pre-defined Functions} +@section[#:tag "intm-w-lambda-pre-defined"]{Pre-defined Functions} @prim-op-defns['(lib "htdp-intermediate-lambda.ss" "lang") #'here '()] diff --git a/collects/teachpack/error-composition.scrbl b/collects/teachpack/error-composition.scrbl index 25ecbf339d..bc06a878a5 100755 --- a/collects/teachpack/error-composition.scrbl +++ b/collects/teachpack/error-composition.scrbl @@ -3,12 +3,12 @@ (for-label racket/base) ) -@title[#:style '(toc)]{Error Message Composition Guidelines for *SL} +@title[#:tag "error-guidelines"]{Error Message Composition Guidelines for *SL} -These guidelines distill our current thoughts on writing good error messages -for novices, as informed by our research. Please apply these to all code you -write, including libraries and Teachpacks. Inform Kathi, Shriram, and -Guillaume of any cases that appear awkward under these guidelines. +These guidelines distill our current thoughts on writing good error messages for +novices, as informed by our research. Please apply these to all code you write +that's intended for beginners, including libraries and Teachpacks. It will +ensure your error messages harmonizes with those of the teaching languages. @section{General Guidelines} @@ -21,32 +21,27 @@ if only because they have no reason to doubt the authoritative voice of the tool.} @item{Be concise and clear. Students give up reading error messages if the text is -too long, uses obscure words, or employs difficult grammar. -}] +too long, uses obscure words, or employs difficult grammar.}] @section{Message Structure and Form} @itemize[ @item{Start the message with the name of the construct whose constraint is being -violated, followed by a colon. -} +violated, followed by a colon.} @item{State the constraint that was violated (``expected a...''), then contrast with what was found. For example, @emph{``this function expects two arguments, but found only one.''} If needed, explain how what was found failed to satisfy the constraint. Write somewhat anthropomorphically with an objective voice that is neither -friendly nor antagonistic. -} +friendly nor antagonistic.} @item{If an expression contains multiple errors, report the leftmost error first: e.g., the error in (define 1 2 3) is @emph{``expected the variable name, but found a number''}, not @emph{``expected 2 parts after define, but found 3''}. Before raising an error about a sub-part, call @racket[local-syntax-expand] on all sub-expressions to -the left to trigger their errors. -} +the left to trigger their errors.} @item{State the number of parts instead of saying ``found too many parts.'' Write the -code necessary to make plurals agree. -}] +code necessary to make plurals agree.}] @section{Vocabulary} @@ -59,19 +54,16 @@ top level, structure name, type name, field name, binding.}} @itemize[ @item{Use ‘binding’ for the square-braced pair in a let and other similar binding -forms. -} +forms.} @item{Use ‘argument’ for actual arguments and ‘variable’ for formal arguments and in -the body of the definition. -} +the body of the definition.} @item{Use ‘part’ when speaking about an s-expression that is not an expression, either because it is malformed, because it occurs in a non-expression position, or because it is a valid piece of syntax for a macro invocation. A well-formed and well-placed call to a function, primitive, or macro is not a ‘part’, it is -an ‘expression’. -}] +an ‘expression’. }] @subsection{Prohibited Words} @@ -107,19 +99,16 @@ variable but found a cond''}] @subsection{General Vocabulary Guidelines} - @itemize[ @item{Avoid modifiers that are not necessary to disambiguate. Write ‘variable’ instead of ``local variable'', ``defined variable'', or ``input variable''. Write ‘clause’ instead of ``question-answer clause''. If they appear necessary for disambiguation, try to find some other way to achieve this (and drop the -modifier). -} +modifier).} @item{When introducing macros with sub-parts, reuse existing vocabulary words, such as ‘clause’ or ‘binding’ (if appropriate), or just ‘part’, instead of defining -new terms. -} +new terms.} @item{Use ‘name’ only when describing the syntax of a definition form. For example, the define form in BSL should say ``expected at least one variable after the @@ -130,18 +119,27 @@ distinction when they learn about lambdathe first is the lambda implicit in the definition, the second is the variable introduced by the definition that can appear as the first argument to set!, the third is the particular sequence of lettersbut BSL should avoid this complexity, and ASL’s error messages should -maintain consistency with BSL.] -} +maintain consistency with BSL.]} -@item{Avoid introducing technical vocabulary, even if well-known to a mathematician. -}] +@item{Avoid introducing technical vocabulary, even if well-known to a mathematician.}] @section{Punctuation} +@itemize[ +@item{Do not use any punctuation beyond those of the normal English language. Do not +write <> around type names, and do not write ` ‘ around keywords.}] +@section{Runtime Behavior} @itemize[ -@item{Do not use any punctuation beyond those of the normal English language. Do not -write <> around type names, and do not write ` ‘ around keywords. -}] - +@item{When specifying a function's behavior, say ``the function takes ... and returns ...''} + +@item{When describing a contract violation, say ``the function expects ... but received ...''} + +@item{As much as possible, identify expressions to the value they evaluate to, +e.g. ``the value of @tt{(f x)} is 5''. If it is necessary to explicate +evaluation times, the context discusses mutable state or order of evaluation, +then say that the expressions ``evaluate to'' a value. Function calls are a +special case of expression. Prefer ``the function call returns'', instead of +``it evaluates to'', except when trying to draw attention to you evaluation of +the arguments.}] diff --git a/collects/teachpack/htdp/scribblings/arrow-gui.scrbl b/collects/teachpack/htdp/scribblings/arrow-gui.scrbl index 6c820e33f8..8d69ea5c19 100644 --- a/collects/teachpack/htdp/scribblings/arrow-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/arrow-gui.scrbl @@ -7,8 +7,8 @@ @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. +The teachpack provides functions for creating and manipulating an arrow +GUI. We recommend using @racketmodname[2htdp/universe] instead. @deftech{modelT} @racket[(-> button% event% true)] diff --git a/collects/teachpack/htdp/scribblings/arrow.scrbl b/collects/teachpack/htdp/scribblings/arrow.scrbl index 11334bea28..bf929f99be 100644 --- a/collects/teachpack/htdp/scribblings/arrow.scrbl +++ b/collects/teachpack/htdp/scribblings/arrow.scrbl @@ -8,9 +8,7 @@ @;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 @racket[move] and @racket[draw] -operations can be drawn. +The teachpack implements a controller for moving shapes across a canvass. @defproc[(control-left-right [shape Shape] diff --git a/collects/teachpack/htdp/scribblings/convert.scrbl b/collects/teachpack/htdp/scribblings/convert.scrbl index c611d4c03c..c847f33f22 100644 --- a/collects/teachpack/htdp/scribblings/convert.scrbl +++ b/collects/teachpack/htdp/scribblings/convert.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/convert)) + (for-label racket teachpack/htdp/convert)) @teachpack["convert"]{Converting Temperatures} diff --git a/collects/teachpack/htdp/scribblings/dir.scrbl b/collects/teachpack/htdp/scribblings/dir.scrbl index 7577ca78d3..71712fa23f 100644 --- a/collects/teachpack/htdp/scribblings/dir.scrbl +++ b/collects/teachpack/htdp/scribblings/dir.scrbl @@ -1,16 +1,16 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label (except-in scheme/base file-size) + (for-label (except-in racket/base file-size) teachpack/htdp/dir - scheme/contract)) + racket/contract)) @teachpack["dir"]{Working with Files and Directories} @;declare-exporting[teachpack/htdp/dir] @defmodule[#:require-form beginner-require htdp/dir] -The teachpack provides structures and operations for working with files and +The teachpack provides structures and functions for working with files and directories: @defstruct[dir ([name symbol?][dirs (listof dir?)][files (listof file?)])]{} diff --git a/collects/teachpack/htdp/scribblings/docs.scrbl b/collects/teachpack/htdp/scribblings/docs.scrbl index 990cba54c5..c4b308fd92 100644 --- a/collects/teachpack/htdp/scribblings/docs.scrbl +++ b/collects/teachpack/htdp/scribblings/docs.scrbl @@ -1,22 +1,22 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/docs)) + (for-label racket teachpack/htdp/docs)) @teachpack["docs"]{Manipulating Simple HTML Documents} @;declare-exporting[teachpack/htdp/docs] @defmodule[#:require-form beginner-require htdp/docs] -The teachpack provides three operations for creating simple ``HTML'' documents: +The teachpack provides three functions for creating simple ``HTML'' documents: @deftech{Annotation} An @tech{Annotation} is a symbol that starts with ``<'' and ends in ``>''. An end annotation is one that starts with ``''. -@defproc[(atom? [x any/c]) boolean?]{Determines whether or not a Scheme value +@defproc[(atom? [x any/c]) boolean?]{Determines whether or not a value is a number, a symbol, or a string.} -@defproc[(annotation? [x any/c]) boolean?]{Determines whether or not a Scheme +@defproc[(annotation? [x any/c]) boolean?]{Determines whether or not a symbol is a document annotation.} @defproc[(end-annotation [x (unsyntax @tech{Annotation})]) (unsyntax @tech{Annotation})]{Consumes an annotation diff --git a/collects/teachpack/htdp/scribblings/draw.scrbl b/collects/teachpack/htdp/scribblings/draw.scrbl index 3d5df4b52f..258e218af4 100644 --- a/collects/teachpack/htdp/scribblings/draw.scrbl +++ b/collects/teachpack/htdp/scribblings/draw.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/draw)) + (for-label racket teachpack/htdp/draw)) @teachpack["draw"]{Simple Drawing} @@ -58,8 +58,8 @@ Draws @racket[s] at @racket[p].} @defproc[(sleep-for-a-while [s number?]) true]{ Suspends evaluation for @racket[s] seconds.} -The teachpack also provides @racket[clear-] operations for each -@racket[draw-] operation: +The teachpack also provides @racket[clear-] functions for each +@racket[draw-] function: @defproc[(clear-circle [p posn?] [r number?] [c (unsyntax @tech{DrawColor})]) true]{ diff --git a/collects/teachpack/htdp/scribblings/elevator.scrbl b/collects/teachpack/htdp/scribblings/elevator.scrbl index 08c1bafaec..84030deb6b 100644 --- a/collects/teachpack/htdp/scribblings/elevator.scrbl +++ b/collects/teachpack/htdp/scribblings/elevator.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/elevator)) + (for-label racket teachpack/htdp/elevator)) @teachpack["elevator"]{Controlling an Elevator} diff --git a/collects/teachpack/htdp/scribblings/graphing.scrbl b/collects/teachpack/htdp/scribblings/graphing.scrbl index f779950a6f..241a622615 100644 --- a/collects/teachpack/htdp/scribblings/graphing.scrbl +++ b/collects/teachpack/htdp/scribblings/graphing.scrbl @@ -1,14 +1,14 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/graphing)) + (for-label racket teachpack/htdp/graphing)) @teachpack["graphing"]{Graphing Functions} @;declare-exporting[teachpack/htdp/graphing] @defmodule[#:require-form beginner-require htdp/graphing #:use-sources (htdp/draw)] -The teachpack provides two operations for graphing functions in the regular +The teachpack provides two functions for graphing functions in the regular (upper right) quadrant of the Cartesian plane (between 0 and 10 in both directions): diff --git a/collects/teachpack/htdp/scribblings/guess-gui.scrbl b/collects/teachpack/htdp/scribblings/guess-gui.scrbl index 5088cf8ec7..e81c59d4e2 100644 --- a/collects/teachpack/htdp/scribblings/guess-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/guess-gui.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/guess-gui)) + (for-label racket teachpack/htdp/guess-gui)) @teachpack["guess-gui"]{Guess GUI} diff --git a/collects/teachpack/htdp/scribblings/guess.scrbl b/collects/teachpack/htdp/scribblings/guess.scrbl index a2f007e5c7..91b1a28dd8 100644 --- a/collects/teachpack/htdp/scribblings/guess.scrbl +++ b/collects/teachpack/htdp/scribblings/guess.scrbl @@ -1,17 +1,17 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/guess)) + (for-label racket teachpack/htdp/guess)) @teachpack["guess"]{Guessing Numbers} @;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 +The teachpack provides functions to play a guess-the-number game. Each +function display a GUI in which a player can choose specific values for some number of digits and then check the guess. The more advanced -operations ask students to implement more of the game. +functions ask students to implement more of the game. @defproc[(guess-with-gui [check-guess (-> number? number? symbol?)]) true]{ The @racket[check-guess] function consumes two numbers: @racket[guess], which diff --git a/collects/teachpack/htdp/scribblings/gui.scrbl b/collects/teachpack/htdp/scribblings/gui.scrbl index a5adc9cce8..ab9db7985b 100644 --- a/collects/teachpack/htdp/scribblings/gui.scrbl +++ b/collects/teachpack/htdp/scribblings/gui.scrbl @@ -1,16 +1,15 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/gui)) + (for-label racket teachpack/htdp/gui)) @teachpack["gui"]{Simple Graphical User Interfaces} @;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} -instead. +The teachpack provides functions for creating and manipulating graphical +user interfaces. We recommend using @racketmodname[2htdp/universe] instead. @deftech{Window} A @tech{Window} is a data representation of a visible window on your computer screen. diff --git a/collects/teachpack/htdp/scribblings/hangman-play.scrbl b/collects/teachpack/htdp/scribblings/hangman-play.scrbl index 5d4826d466..0a98f03a4a 100644 --- a/collects/teachpack/htdp/scribblings/hangman-play.scrbl +++ b/collects/teachpack/htdp/scribblings/hangman-play.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/hangman)) + (for-label racket teachpack/htdp/hangman)) @teachpack["hangman-play"]{Playing Hangman} diff --git a/collects/teachpack/htdp/scribblings/hangman.scrbl b/collects/teachpack/htdp/scribblings/hangman.scrbl index 1e12704f37..00732eb0ff 100644 --- a/collects/teachpack/htdp/scribblings/hangman.scrbl +++ b/collects/teachpack/htdp/scribblings/hangman.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/hangman)) + (for-label racket teachpack/htdp/hangman)) @teachpack["hangman"]{Hangman} diff --git a/collects/teachpack/htdp/scribblings/htdp.scrbl b/collects/teachpack/htdp/scribblings/htdp.scrbl index effee3f60b..dbba7fce27 100644 --- a/collects/teachpack/htdp/scribblings/htdp.scrbl +++ b/collects/teachpack/htdp/scribblings/htdp.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual - (for-label scheme)) + (for-label racket)) @title[#:style '(toc) #:tag "htdp"]{HtDP Teachpacks} @@ -32,6 +32,6 @@ @;-- what do those do? -- -@;include-section["Simplified Scheme Web Servlets"] -@;include-section["Scheme Web Servlets"] +@;include-section["Simplified Racket Web Servlets"] +@;include-section["Racket Web Servlets"] diff --git a/collects/teachpack/htdp/scribblings/image.scrbl b/collects/teachpack/htdp/scribblings/image.scrbl index e946928e57..22f474e179 100644 --- a/collects/teachpack/htdp/scribblings/image.scrbl +++ b/collects/teachpack/htdp/scribblings/image.scrbl @@ -1,14 +1,14 @@ #lang scribble/doc -@(require scribble/manual "shared.rkt" (for-label scheme teachpack/htdp/image)) +@(require scribble/manual "shared.rkt" (for-label racket teachpack/htdp/image)) @teachpack["image"]{Manipulating Images} @defmodule[#:require-form beginner-require htdp/image] -The teachpack provides primitives for constructing and manipulating +The teachpack provides functions for constructing and manipulating images. Basic, colored images are created as outlines or solid -shapes. Additional primitives allow for the composition of images. +shapes. Additional functions allow for the composition of images. @;----------------------------------------------------------------------------- @section{Images} @@ -47,7 +47,7 @@ A @tech{Color} is a color-symbol (e.g., @racket['blue]) or a color-string @section[#:tag "creational"]{Creating Basic Shapes} In DrRacket, you can insert images from your file system. Use PNG images -instead whenever possible for insertions. In addition, you can create basic +whenever possible. In addition, you can create basic shapes with the following functions. @defproc[(rectangle [w (and/c number? (or/c zero? positive?))] [h (and/c number? (or/c zero? positive?))] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})]) image?]{ @@ -104,9 +104,9 @@ basic properties of images. @defproc[(image-height [i image?]) integer?]{ Obtain @racket[i]'s height in pixels} -For the composition of images, you must know about @emph{pinholes}. Each -image, including primitive ones, come with a pinhole. For images created -with the above primitives, the pinhole is at the center of the shape except +For the composition of images, you must know about @emph{pinholes}. Every +image come with a pinhole. For images created +with the above functions, the pinhole is at the center of the shape except for those created from @racket[line] and @racket[text]. The @racket[text] function puts the pinhole at the upper left corner of the image, and @racket[line] puts the pinhole at the beginning of the line diff --git a/collects/teachpack/htdp/scribblings/lkup-gui.scrbl b/collects/teachpack/htdp/scribblings/lkup-gui.scrbl index 818b8c1e27..70c58b5650 100644 --- a/collects/teachpack/htdp/scribblings/lkup-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/lkup-gui.scrbl @@ -1,6 +1,6 @@ #lang scribble/doc -@(require scribble/manual "shared.rkt" (for-label scheme teachpack/htdp/lkup-gui)) +@(require scribble/manual "shared.rkt" (for-label racket teachpack/htdp/lkup-gui)) @teachpack["lkup-gui"]{Lookup GUI} diff --git a/collects/teachpack/htdp/scribblings/master-play.scrbl b/collects/teachpack/htdp/scribblings/master-play.scrbl index 7a762a3acd..dd1d0c6300 100644 --- a/collects/teachpack/htdp/scribblings/master-play.scrbl +++ b/collects/teachpack/htdp/scribblings/master-play.scrbl @@ -1,6 +1,6 @@ #lang scribble/doc -@(require scribble/manual "shared.rkt" (for-label scheme teachpack/htdp/master)) +@(require scribble/manual "shared.rkt" (for-label racket teachpack/htdp/master)) @teachpack["master-play"]{Playing MasterMind} diff --git a/collects/teachpack/htdp/scribblings/master.scrbl b/collects/teachpack/htdp/scribblings/master.scrbl index 7c08594651..8d7db94e0e 100644 --- a/collects/teachpack/htdp/scribblings/master.scrbl +++ b/collects/teachpack/htdp/scribblings/master.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/master)) + (for-label racket teachpack/htdp/master)) @teachpack["master"]{MasterMinding} diff --git a/collects/teachpack/htdp/scribblings/matrix.scrbl b/collects/teachpack/htdp/scribblings/matrix.scrbl index a6b29018f5..125b4e5da3 100644 --- a/collects/teachpack/htdp/scribblings/matrix.scrbl +++ b/collects/teachpack/htdp/scribblings/matrix.scrbl @@ -3,22 +3,22 @@ @(require scribble/manual "shared.rkt" (for-label scheme teachpack/htdp/matrix lang/posn)) -@teachpack["matrix"]{Matrix Operations} +@teachpack["matrix"]{Matrix Functions} @;declare-exporting[teachpack/htdp/matrix] @defmodule[#:require-form beginner-require htdp/matrix] -The experimental teachpack supports matrices and matrix operations. A +The experimental teachpack supports matrices and matrix functions. 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, scenes in the sense of the @secref["world"]. @emph{No educational materials involving matrices exist.} -The operations access a matrix in the usual (school-mathematics) manner: +The functions access a matrix in the usual (school-mathematics) manner: row first, column second. -The operations aren't tuned for efficiency so don't expect to build +The functions aren't tuned for efficiency so don't expect to build programs that process lots of data. @deftech{Rectangle} diff --git a/collects/teachpack/htdp/scribblings/servlet.thtml b/collects/teachpack/htdp/scribblings/servlet.thtml index 1b51fbeb5d..84c43151ea 100644 --- a/collects/teachpack/htdp/scribblings/servlet.thtml +++ b/collects/teachpack/htdp/scribblings/servlet.thtml @@ -1,8 +1,8 @@ -{ (define LIBNAME "Scheme Web Servlets") +{ (define LIBNAME "Racket Web Servlets") (include "head.tinc") }
The teachpack servlet.ss
provides structures and
-functions for building Web servlets in Scheme. The data definitions
+functions for building Web servlets in Racket. The data definitions
represent HTTP requests and Web page responses using these two structures:
diff --git a/collects/teachpack/htdp/scribblings/servlet2.thtml b/collects/teachpack/htdp/scribblings/servlet2.thtml index 85ee30dddc..779dce3872 100644 --- a/collects/teachpack/htdp/scribblings/servlet2.thtml +++ b/collects/teachpack/htdp/scribblings/servlet2.thtml @@ -1,7 +1,7 @@ -{ (define LIBNAME "Simplified Scheme Web Servlets") +{ (define LIBNAME "Simplified Racket Web Servlets") (include "head.tinc") } -This teachpack provides a simplified API for PLT Scheme servlets. The +
This teachpack provides a simplified API for Racket servlets. The teachpack does not require any understanding of HTML and higher-order functions. It uses structures and lists, and is therefore well-suited for use with an HtDP course. @@ -134,7 +134,7 @@ ________________________________________________________________________________
The following example illustrates how the library enables programs to interact with the consumer. In particular, note the properly recursive calls to
login
ininform-error
. Also note how the -primitivesmake-password
andmake-number
deliver +functionsmake-password
andmake-number
return strings and numbers, respectively.diff --git a/collects/teachpack/htdp/scribblings/shared.rkt b/collects/teachpack/htdp/scribblings/shared.rkt index b46c9716f7..09d00dc9d5 100644 --- a/collects/teachpack/htdp/scribblings/shared.rkt +++ b/collects/teachpack/htdp/scribblings/shared.rkt @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scribble/manual) diff --git a/collects/teachpack/htdp/scribblings/show-queen.scrbl b/collects/teachpack/htdp/scribblings/show-queen.scrbl index 24d14689ff..c7ec1e0914 100644 --- a/collects/teachpack/htdp/scribblings/show-queen.scrbl +++ b/collects/teachpack/htdp/scribblings/show-queen.scrbl @@ -1,14 +1,14 @@ #lang scribble/doc @(require scribble/manual "shared.rkt" - (for-label scheme teachpack/htdp/show-queen)) + (for-label racket teachpack/htdp/show-queen)) @teachpack["show-queen"]{Queens} @;declare-exporting[teachpack/htdp/show-queen] @defmodule[#:require-form beginner-require htdp/show-queen] -The teachpack provides the operation @racket[show-queen], which implements +The teachpack provides the function @racket[show-queen], which implements a GUI for exploring the n-queens problem. @defproc[(show-queen [board (list-of (list-of boolean?))]) true]{The diff --git a/collects/teachpack/htdp/scribblings/world.scrbl b/collects/teachpack/htdp/scribblings/world.scrbl index cd2f94c076..995298bbc7 100644 --- a/collects/teachpack/htdp/scribblings/world.scrbl +++ b/collects/teachpack/htdp/scribblings/world.scrbl @@ -4,7 +4,7 @@ (only-in scribble/core make-nested-flow make-style) "shared.rkt" scribble/struct - (for-label scheme + (for-label racket teachpack/htdp/image teachpack/htdp/world)) @@ -32,7 +32,7 @@ to Design Programs, Second Edition: Prologue}. As of August 2008, we also have a series of projects available as a small booklet on @link["http://world.cs.brown.edu/"]{How to Design Worlds}. -The purpose of this documentation is to give experienced Schemers a concise +The purpose of this documentation is to give experienced Racketers a concise overview for using the library and for incorporating it elsewhere. The last section presents @secref["example"] for an extremely simple domain and is suited for a novice who knows how to design conditional functions for @@ -59,7 +59,7 @@ second one generalizes the first by adding interactive GUI features. true]{ creates and shows a canvas of width @racket[w] and height @racket[h] , starts a clock, making it tick every @racket[r] (usually fractional) - seconds. Every time the clock ticks, drscheme applies @racket[create-image] to + seconds. Every time the clock ticks, @racket[run-simulation] applies @racket[create-image] to the number of ticks passed since this function call. The results of these applications are displayed in the canvas. } @@ -122,7 +122,7 @@ The following picture provides an intuitive overview of the workings of generation of images from the animation, including an animated GIF image. } @defproc[(on-tick-event [tock (-> (unsyntax @tech{World}) (unsyntax @tech{World}))]) true]{ - Tell DrRacket to call @racket[tock] on the current world every time the + Tells @racket[big-bang] to call @racket[tock] on the current world every time the clock ticks. The result of the call becomes the current world.} @deftech{KeyEvent} @racket[(or/c char? symbol?)] @@ -141,7 +141,7 @@ A @tech{KeyEvent} represents key board events, e.g., keys pressed or compares two @tech{KeyEvent} for equality} @defproc[(on-key-event [change (-> (unsyntax @tech{World}) key-event? (unsyntax @tech{World}))]) true]{ - Tell DrRacket to call @racket[change] on the current world and a + Tells @racket[big-bang] to call @racket[change] on the current world and a @tech{KeyEvent} for every keystroke the user of the computer makes. The result of the call becomes the current world. @@ -167,17 +167,17 @@ A @tech{KeyEvent} represents key board events, e.g., keys pressed or computer's user. @defproc[(on-mouse-event [clack (-> (unsyntax @tech{World}) natural-number/c natural-number/c (unsyntax @tech{MouseEvent}) (unsyntax @tech{World}))]) true]{ - Tell DrRacket to call @racket[clack] on the current world, the current + Tells @racket[big-bang] to call @racket[clack] on the current world, the current @racket[x] and @racket[y] coordinates of the mouse, and a @tech{MouseEvent} for every action of the mouse by the user of the computer. The result of the call becomes the current world.} -@defproc[(on-redraw [to-scene (-> (unsyntax @tech{World}) (unsyntax @tech{Scene}))]) true]{ Tell DrRacket to call @racket[to-scene] +@defproc[(on-redraw [to-scene (-> (unsyntax @tech{World}) (unsyntax @tech{Scene}))]) true]{ Tells @racket[big-bang] to call @racket[to-scene] whenever the canvas must be redrawn. The canvas is usually re-drawn after a tick event, a keyboard event, or a mouse event has occurred. The generated scene is displayed in the world's canvas.} @defproc[(stop-when [last-world? (-> (unsyntax @tech{World}) boolean?)]) true]{ - Tell DrRacket to call @racket[last-world?] whenever the canvas is + Tells @racket[big-bang] to call @racket[last-world?] whenever the canvas is drawn. If this call produces @racket[true], the clock is stopped; no more tick events, @tech{KeyEvent}s, or @tech{MouseEvent}s are forwarded to the respective handlers. As a result, the canvas isn't updated either.} @@ -259,7 +259,7 @@ Simulating any dynamic behavior via a program demands two different definition makes it easy for readers to map data to information in the real world and vice versa. For all others aspects of the world, we use global constants, including graphical or visual constants that are used in - conjunction with the rendering operations. + conjunction with the rendering functions. Second, we must translate the "world" actions---the arrows in the above diagram---into interactions with the computer that the world teachpack can @@ -485,5 +485,5 @@ which function takes care of tick events, key events, and redraws: (on-redraw render) )) -Now it's time for you to collect the pieces and run them in DrRacket to see +Now it's time for you to collect the pieces and run them in @racket[big-bang] to see whether it all works. diff --git a/collects/teachpack/htdp/testing.ss b/collects/teachpack/htdp/testing.ss index ae3e4d29f1..3739d03b18 100644 --- a/collects/teachpack/htdp/testing.ss +++ b/collects/teachpack/htdp/testing.ss @@ -1,3 +1,3 @@ -#lang scheme +#lang racket (require htdp/testing) (provide (all-from-out htdp/testing)) diff --git a/collects/teachpack/teachpack.scrbl b/collects/teachpack/teachpack.scrbl index 48c0ac8266..43c3f5926e 100644 --- a/collects/teachpack/teachpack.scrbl +++ b/collects/teachpack/teachpack.scrbl @@ -3,7 +3,7 @@ @(require scribble/manual (for-label scheme/base)) -@title[#:style '(toc)]{@italic{How to Design Programs} Teachpacks} +@title[#:style '(toc) #:tag "top"]{@italic{How to Design Programs} Teachpacks} Teaching languages are small subsets of a full programming language. While such restrictions simplify error diagnosis and the construction of tools,