It looks like run-teaching-program hasn't been touched in quite a while.
To begin with, the "rewrite-module" function used to add code to print
out values of non-define exprs, but this is no longer necessary. In fact,
the only thing that it does now is to discard "provide" statements, and
even this may be unnecessary. I rewrote big chunks of this (short) file
to introduce defines, eliminate unnecessary functions, and add stepper-
skip-completely annotations to the requires associated with teachpacks.
Also, it appears that the 'rep' argument to expand-teaching-program
was entirely superfluous; I removed it from the argument list, and also
from the three places in the main tree (deinprogramm, lang, and the stepper)
that call this function.
Let me know of any problems seen with teachpack requires....
including adding some uses of `with-module-read-parameterization'
so that `read-accept-lang' is set right anyway; still, so many
many places just set `read-accept-reader' to #t that making
`read-accept-lang' #f by default looks like too big of an
incompatibility
... and generalize it so there's an action before (clearing the old
tests out) in addition to after (displaying the test results).
Also, do for DMdA as for HtDP.
`test-covered' to use just the expression -- looks like there's no
reason to use an additional key.
Also, change its uses to map each syntax to an mcons where its mcar is
used to track coverage. This is done everywhere, since it turns out to
be much faster to insert a `set-mcar!' with a 3d mpair, rather than a
call to a thunk.
Note that it still uses mpairs as a hack. It "works" in the same way
that this simplified example does:
(define-syntax m
(let ([b (mcons 0 0)])
(lambda (stx)
(with-syntax ([b b])
#'(case-lambda [() (mcar b)]
[(x) (set-mcar! b x)])))))
I think that it's fragile, and likely to stop working at some point, but
I don't see anything better for now.
Known breakage: when blame is assigned to a procedure defined via
(define (f ...) ...), its source position isn't reported because its
lambda expression is generated.