add htdp-lib doc

svn: r9417
This commit is contained in:
Matthew Flatt 2008-04-23 02:06:47 +00:00
parent a212d63387
commit fe7b6fd26e
8 changed files with 170 additions and 6 deletions

View File

@ -0,0 +1,162 @@
#lang scribble/doc
@(require scribble/manual
scribble/eval
(for-label scheme/base
scheme/contract
scheme/class
scheme/gui/base
lang/posn
lang/imageeq
lang/prim))
@(define htdp @italic{How to Design Programs})
@(define (htdp-ref s) @secref[#:doc '(lib "scribblings/htdp-langs/htdp-langs.scrbl") s])
@title{@bold{HtDP}: Languages as Libraries}
@; ------------------------------------------------------------
@section{@italic{HtDP} Beginning Student}
@defmodule[lang/htdp-beginner]
The @schememodname[lang/htdp-beginner] module provides the Beginning
Student language for @|htdp|; see @htdp-ref["beginner"].
@; ------------------------------------------------------------
@section{@italic{HtDP} Beginning Student with Abbreviations}
@defmodule[lang/htdp-beginner-abbr]
The @schememodname[lang/htdp-beginner-abbr] module provides the
Beginning Student with Abbreviations language for @|htdp|; see
@htdp-ref["beginner-abbr"].
@; ------------------------------------------------------------
@section{@italic{HtDP} Intermediate Student}
@defmodule[lang/htdp-intermediate]
The @schememodname[lang/htdp-intermediate] module provides the
Intermediate Student language for @|htdp|; see
@htdp-ref["intermediate"].
@; ------------------------------------------------------------
@section{@italic{HtDP} Intermediate Student with Lambda}
@defmodule[lang/htdp-intermediate-lam]
The @schememodname[lang/htdp-intermediate-lam] module provides the
Intermediate Student with Lambda language for @|htdp|; see
@htdp-ref["intermediate-lam"].
@; ------------------------------------------------------------
@section{@italic{HtDP} Advanced Student}
@defmodule[lang/htdp-advanced]
The @schememodname[lang/htdp-advanced] module provides the Advanced
Student language for @|htdp|; see @htdp-ref["advanced"].
@; ------------------------------------------------------------
@section{Pretty Big Text (Legacy Language)}
@defmodule[lang/plt-pretty-big-text]
The @schememodname[lang/plt-pretty-big-text] module is similar to the
@italic{HtDP} Advanced Student language, but with more of PLT Scheme's
libraries. It provides the bindings of @schememodname[mzscheme],
@schememodname[mzlib/etc], @schememodname[mzlib/file],
@schememodname[mzlib/list], @schememodname[mzlib/class],
@schememodname[mzlib/unit], @schememodname[mzlib/include],
@schememodname[mzlib/defmacro], @schememodname[mzlib/pretty],
@schememodname[mzlib/string], @schememodname[mzlib/thread],
@schememodname[mzlib/math], @schememodname[mzlib/match],
@schememodname[mzlib/shared], and @schememodname[lang/posn].
@; ------------------------------------------------------------
@section{Pretty Big (Legacy Language)}
@defmodule[lang/plt-pretty-big]
The @schememodname[lang/plt-pretty-big] module extends
@scheme[lang/plt-pretty-big-text] with @schememodname[scheme/gui/base]
and @schememodname[lang/imageeq]. This language corresponds to the
@onscreen{Pretty Big Scheme} legacy language in DrScheme.
@; ----------------------------------------------------------------------
@section{@scheme[posn]s in @italic{HtDP} Languages}
@defmodule[lang/posn]
@defstruct[posn ([x any/c] [y any/c])]{
The @scheme[posn] structure type that is also provided by
@scheme[lang/htdp-beginner].}
@; ----------------------------------------------------------------------
@section{Image Equality in @italic{HtDP} Languages}
@defmodule[lang/imageeq]
@defproc[(image=? [i1 (is-a?/c image-snip%)]
[i2 (is-a?/c image-snip%)])
boolean?]{
The image-comparison operator that is also provided by
@scheme[lang/htdp-beginner].}
@; ----------------------------------------------------------------------
@section{Higher-order Primitives in @italic{HtDP} Beginner}
@defmodule[lang/prim]
The @schememodname[lang/prim] module defines two syntactic forms for
use by the implementors of teachpacks, which the teachpack is to be
used with the @|htdp| Beginner Student
languages. In Beginner Student, primitive names (for built-in
procedures) are distinguished from other types of expressions, so that
they can be syntactically restricted to application positions.
@defform[(define-higher-order-primitive id proc-id (arg ...))]{
Defines @scheme[id] to be a primitive operator whose implementation is
@scheme[proc-id]. Normally, @scheme[id] is exported from the teachpack and
@scheme[proc-id] is not.
For each non-procedure argument, the corresponding @scheme[arg] should be
an underscore. For each procedure argument, the corresponding @scheme[arg]
should be the usual name of the procedure.
@as-examples[
@schemeblock[
(define-higher-order-primitive convert-gui convert-gui/proc (f2c))
]]
}
@defform[(provide-higher-order-procedure id (arg ...))]{
Like @scheme[define-higher-order-primitive], but the function
@scheme[id] is exported as the primitive operator named
@scheme[id].}
@defform[(define-primitive id proc-id)]{
Defines @scheme[id] to be a primitive operator whose implementation
is @scheme[proc-id], and that takes no procedures as
arguments. Normally, @scheme[id] is exported from the teachpack and
@scheme[proc-id] is not.}
@defform[(provide-primitive id)]{
Like @scheme[define-primitive], but the function @scheme[id] is
exported as the primitive operator named @scheme[id].}
@defform[(provide-primitives id ...)]{
Multiple-identifier version of @scheme[provide-primitive].}

View File

@ -14,3 +14,5 @@
(string-constant teaching-languages)
(string-constant how-to-design-programs)
(string-constant beginning-student))))
(define scribblings '(("htdp-lib.scrbl")))

View File

@ -31,7 +31,7 @@
@(bbd beg-define beg-define-struct beg-cond beg-if beg-and beg-or beg-check-expect beg-require)
@title[#:style 'toc]{Advanced Student}
@title[#:style 'toc #:tag "advanced"]{Advanced Student}
@declare-exporting[lang/htdp-advanced]

View File

@ -18,7 +18,7 @@
@(bd beg-define beg-define-struct beg-cond beg-if beg-and beg-or beg-check-expect beg-require)
@title[#:style 'toc]{Beginning Student with List Abbreviations}
@title[#:style 'toc #:tag "beginner-abbr"]{Beginning Student with List Abbreviations}
@declare-exporting[lang/htdp-beginner-abbr]

View File

@ -5,7 +5,7 @@
(for-label lang/htdp-beginner))
@title[#:style 'toc]{Beginning Student}
@title[#:style 'toc #:tag "beginner"]{Beginning Student}
@declare-exporting[lang/htdp-beginner]

View File

@ -30,7 +30,7 @@
@(bbd beg-define beg-define-struct beg-cond beg-if beg-and beg-or beg-check-expect beg-require)
@title[#:style 'toc]{Intermediate Student with Lambda}
@title[#:style 'toc #:tag "intermediate-lam"]{Intermediate Student with Lambda}
@declare-exporting[lang/htdp-intermediate-lambda]

View File

@ -17,7 +17,7 @@
(define beg-require (scheme require))))
@(bd beg-define beg-define-struct beg-cond beg-if beg-and beg-or beg-check-expect beg-require)
@title[#:style 'toc]{Intermediate Student}
@title[#:style 'toc #:tag "intermediate"]{Intermediate Student}
@declare-exporting[lang/htdp-intermediate]

View File

@ -243,7 +243,7 @@ Optional @filepath{info.ss} fields trigger additional actions by
manuals with the same sorting position are ordered
alphabetically. For a pair of manuals with sorting numbers
@scheme[_n] and @scheme[_m], the groups for the manuals are
separated by space or a label if @scheme[(truncate (/ _n 10))]and
separated by space if @scheme[(truncate (/ _n 10))]and
@scheme[(truncate (/ _m 10))] are different.}
@item{@scheme[mzscheme-launcher-names] : @scheme[(listof string?)]