diff --git a/collects/teachpack/2htdp/scribblings/2htdp.scrbl b/collects/teachpack/2htdp/scribblings/2htdp.scrbl index 6b46bc665b..3a11ccc1ed 100644 --- a/collects/teachpack/2htdp/scribblings/2htdp.scrbl +++ b/collects/teachpack/2htdp/scribblings/2htdp.scrbl @@ -7,4 +7,5 @@ @local-table-of-contents[] +@include-section["batch-io.scrbl"] @include-section["universe.scrbl"] diff --git a/collects/teachpack/2htdp/scribblings/batch-io.scrbl b/collects/teachpack/2htdp/scribblings/batch-io.scrbl new file mode 100644 index 0000000000..2daa6fcf1c --- /dev/null +++ b/collects/teachpack/2htdp/scribblings/batch-io.scrbl @@ -0,0 +1,29 @@ +#lang scribble/doc + +@(require scribble/manual "shared.ss" + (for-label scheme teachpack/2htdp/batch-io)) +@(require scribble/struct) + +@; ----------------------------------------------------------------------------- + +@teachpack["batch-io"]{Batch Input/Output} + +@author{Matthias Felleisen} + +@defmodule[#:require-form beginner-require 2htdp/batch-io] + +The batch-io teachpack introduces two functions: @scheme[read-file] and +@scheme[write-file]. It facilitates the reading and writing of entire files +in one batch. + +@defproc[(read-file [f (and/c string? file-exists?)]) string?]{ + reads the content of file @scheme[f], located in the samd folder + (directory) as the program, and produces it as a string. If @scheme[f] + doesn't exist, the function signals an error. +} + +@defproc[(write-file [f string?] [cntnt string?]) boolean?]{ + turns @scheme[cntnt] into the content of file @scheme[f], located in the + same folder (directory) as the program. If the file exists when the + function is called, the function produces @scheme[true]; otherwise it + produces @scheme[false].} diff --git a/collects/teachpack/2htdp/scribblings/universe.scrbl b/collects/teachpack/2htdp/scribblings/universe.scrbl index e8da05e248..4a773a49ad 100644 --- a/collects/teachpack/2htdp/scribblings/universe.scrbl +++ b/collects/teachpack/2htdp/scribblings/universe.scrbl @@ -21,7 +21,7 @@ @; ----------------------------------------------------------------------------- -@title{Worlds and the Universe} +@teachpack["universe"]{Worlds and the Universe} @author{Matthias Felleisen}