so that it changes immediately when the black-on-white and
white-on-black buttons are pushed in the preferences dialog
- expanded the color preferences api a little
to allow the specification of background colors
in addition to the foreground/style information
already there
- changed the test coverage style so that the colors are
settable in the preferences dialog
closes PR 11704
Specifically, when there is an error in the namespace require (say if one of the teachpack
files gets corrupted (because you use a script that monkeys around in the installation, say,
and things go wrong)) then the first-opened method does not return normally, but raises
an exception. This, so far, is not a problem, but it appears that there is a bug in the
implementation of the drracket repl io ports that causes them to deadlock when flushing
the error port under certain conditions (I'm not sure what is really going on with this bug,
but I am observing a call to flush that fails to return) and the error-display-handler
for the teaching languages flushes the output port.
This change just avoids printing the error and so the error display handler is not called
in the fragile state. This change goes back to exactly what was happening in 5.0.2,
at least as far as the teaching language's first-opened method is concerned.
So, if this seems okay, I'd like to suggest it be included in the release.
queue-callback / execute callback dance; also, change the behavior
a little bit so that it works a little bit more like the rest of the
DrRacket languages; in particular, the initialization of the REPL
now only happens when a window is first opened or a new tab is first
created, but not at other times (ie not when the language changes;
when the language changes, we just keep the REPL state the same and
show a warning like before)
This change also required a change to the way the repl is initialized
and a slight change to the behavior of the first-opened method. Specifically,
it is now called in a slightly better context so that errors that
happen look like errors in the user's program. The only other use of
the first-opened method in the tree was to initialize the teachpacks
in the teaching languages and this new behavior is also an improvement
there.
parameter. Specifically, it is expected to be a namespace that has the GUI
bindings available. Unfortunately, during the dynamic extent of the
uncaught-exception-handler when a syntax error is raised, this may not be
the case because you get a phase 1 namespace, not a phase 0 one.
So, move the call to display-results to the code that runs the student language
programs and out of the uncaught exception handler.
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.
language dialog, not the #lang htdp/* variants), teachpacks are put into the
initial REPL (instead of just having the language primitives).
closes PR 11160
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.