diff --git a/collects/teachpack/htdp/matrix.ss b/collects/teachpack/htdp/matrix.ss new file mode 100644 index 0000000000..16f7a3fe35 --- /dev/null +++ b/collects/teachpack/htdp/matrix.ss @@ -0,0 +1,3 @@ +(module matrix mzscheme + (provide (all-from htdp/matrix)) + (require htdp/matrix)) diff --git a/collects/teachpack/htdp/scribblings/matrix.scrbl b/collects/teachpack/htdp/scribblings/matrix.scrbl index 9114db92f3..c5f8b0291a 100644 --- a/collects/teachpack/htdp/scribblings/matrix.scrbl +++ b/collects/teachpack/htdp/scribblings/matrix.scrbl @@ -2,15 +2,23 @@ @(require scribble/manual "shared.ss" (for-label scheme - teachpack/htdp/image - teachpack/htdp/world - lang/private/imageeq)) + teachpack/htdp/matrix + lang/posn)) @teachpack["matrix"]{Matrix Operations} -The 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"]. +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, +scenes in the sense of the @secref["world"]. + +The operations 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 +programs that process lots of data. + + @declare-exporting[teachpack/htdp/matrix] @@ -36,19 +44,20 @@ creates a rectangle from this matrix @scheme[m]} @defproc[(make-matrix [n natural-number/c][m natural-number/c][l (Listof X)]) matrix?]{ creates an @scheme[n] by @scheme[m] matrix from @scheme[l] -NOTE: make-matrix would consume an optional number of entries, if it were -like make-vector} +NOTE: @scheme[make-matrix] would consume an optional number of entries, if +it were like @scheme[make-vector]} -@defproc[(build-matrix [n natural-number/c][m natural-number/c] - [f (-> natural-number/c natural-number/c any)]) - matrix?]{ -creates an @scheme[n] by @scheme[m] matrix by applying @scheme[f] to (0,0), -(0,1), ..., (n-1,m-1)} +@defproc[(build-matrix + [n natural-number/c][m natural-number/c] + [f (-> (and/c natural-number/c (