[r6rs-discuss] [Formal] SRFI-39 should be made an R6RS library
R. Kent Dybvig
dyb at cs.indiana.edu
Sat Feb 10 20:26:01 EST 2007
> I'd like to know what Chez global parameters tend to be used for,
> and whether they are normally set-and-forget things like CL
> defparameter or whether it is common to localize them.
They tend to be used sparingly for things that are inherently global. For
example, the built-in global parameters control what happens when the
system first starts up (e.g., scheme-script, which is called when the
system is started as a script, or command-line, which contains a list of
command-line arguments), garbage collection (e.g., collect-trip-bytes,
which determines after how much allocation a collection is requested), and
the console ports used by the interactive debugger when an error occurs.
Global parameters are typically but not always set once and forgotten; an
application might change the collection parameters, for example, to suit
different modes of operation. It generally doesn't make sense to localize
them, however, or they would be defined as thread parameters.
In contrast, a much wider range of parameters are thread parameters: ones
that control reading or printing (e.g., case-sensitive and print-radix),
handlers for various conditions (e.g., keyboard interrupts, errors,
warnings, resets), the current input/output ports, the trace output port,
compiler behavior (e.g., optimization, profiling), REPL behavior (e.g.,
waiter-prompt-string, interaction-environment), pretty-printer behavior
(e.g., pretty-line-length, pretty-standard-indent), and more.
There are around a dozen built-in global parameters and around four dozen
built-in thread parameters.
Kent
More information about the r6rs-discuss
mailing list