Guile Libraryversion 0.2.8.1, updated April 2024

Andreas Rottmann (rotty at debian dot org)
Andy Wingo (wingo at pobox dot com)
Richard Todd (richardt at vzavenue dot net)
Neil W. Van Dyke (neil at neilvandyke dot org)David Pirotte (david at altosw dot be)
Christopher Baines (mail at cbaines dot net)
Göran Weinhold (weinhold at debian dot org)
Ricardo Wurmus (rekado at elephly dot net)
Ludovic Courtès (ludo at gnu dot org)
Maxim Cournoyer (maxim dot cournoyer at gmail dot com)

This manual is for Guile Library (version 0.2.8.1, updated April 2024)
Copyright 2003,2007,2010,2011,2016,2017,2018,2021,2024 Andreas Rottmann, Andy Wingo,
Richard Todd, Neil W. Van Dyke, David Pirotte, Christopher Baines, Göran Weinhold,
Ricardo Wurmus, Ludovic Courtès, Maxim Cournoyer
Permission is granted to copy, distribute and/or modify this document under theterms of the GNU Free Documentation License, Version 1.2 or any later version
published y the Free Software Foundation; with no Invariant Sections, no FrontCover Texts, and no Back-Cover Texts. A copy of the license is included in thesection entitled "GNU Free Documentation License".

i

Short Contents
1(apicheck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2(config load) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

3(container async-queue) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

45(container nodal-tree) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4(container delay-tree) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

6(debugging assert) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

7(debugging time) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

89(graph topological-sort) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8(htmlprag) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910 (io string) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
11 (logging logger) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 (logging port-log) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
13 (logging rotating-log) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
14 (match-bind) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
15 (math minima) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
16 (math primes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
17 (os process) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
18 (scheme documentation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
19 (scheme kwargs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
20 (search basic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
21 (string completion) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
22 (string soundex) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
23 (string transform) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
24 (string wrap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
25 (term ansi-color) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
26 (unit-test) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
A

Copying This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Function Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

1

1 (apicheck)
1.1 Overview(apicheck) exports two routines. apicheck-generate produces a description of the
Scheme API exported by a set of modules as an S-expression. apicheck-validate
verifies that the API exported by a set of modules is compatible with an API description
generated by apicheck-generate.
It would be nice to have Makefile.am fragments here, but for now, see the Guile-Librarysource distribution for information on how to integrate apicheck with your module’s unit
test suite.

1.2 Usage
apicheck-generate module-names[Function]
Generate a description of the API exported by the set of modules module-names.

apicheck-validate api module-names[Function]
Validate that the API exported by the set of modules module-names is compatible
with the recorded API description api. Raises an exception if the interface is incompatible.

2

2 (config load)
2.1 Overview
This module needs to be documented.

2.2 Usage<configuration>[Class]load-config!

[Generic]load-config!

[Method]&config-error[Variable]

config-error-arguments obj[Function]

3

3 (container async-queue)
3.1 Overview
A asynchronous queue can be used to safely send messages from one thread to another.

3.2 Usage
make-async-queue[Function]

Create a new asynchronous queue.

async-enqueue! q elt[Function]

Enqueue elt into q.

async-dequeue! q[Function]
Dequeue a single element from q. If the queue is empty, the calling thread is blocked
until an element is enqueued by another thread.

44 (container nodal-tree)
4.1 Overview
A nodal tree is a tree composed of nodes, each of which may have children. Nodes are
represented as alists. The only alist entry that is specified is children, which must holda list of child nodes. Other entries are intentionally left unspecified, so as to allow forextensibility.

4.2 Usage
nodal-tree? x[Function]
Predicate to determine if x is a nodal tree. Not particularly efficient: intended fordebugging purposes.

make-node . attributes[Function]node-ref node name

[Function]node-set! node name val[Function]node-children node

[Function]5

5 (container delay-tree)
5.1 Overview
A delay tree is a superset of a nodal tree (see (container nodal-tree)). It extends nodal trees
to allow any entry of the node to be a promise created with the delay operator.

5.2 Usage
force-ref node field[Function]
Access a field in a node of a delay tree. If the value of the field is a promise, thepromise will be forced, and the value will be replaced with the forced value.

6

6 (debugging assert)
6.1 Overview
Defines an assert macro, and the cout and cerr utility functions.

6.2 Usage
assert doit (expr ...) (r-exp ...)
assert collect (expr ...)
assert collect (expr ...) report: r-exp ...
assert collect (expr ...) expr1 stuff ...
assert stuff ...

[Special Form][Special Form][Special Form][Special Form][Special Form]

Assert the truth of an expression (or of a sequence of expressions).
syntax: assert ?expr ?expr ... [report: ?r-exp ?r-exp ...]
If (and ?expr ?expr ...) evaluates to anything but #f, the result is the value of that
expression. Otherwise, an error is reported.
The error message will show the failed expressions, as well as the values of selectedvariables (or expressions, in general). The user may explicitly specify the expressions
whose values are to be printed upon assertion failure – as ?r-exp that follow theidentifier report:.
Typically, ?r-exp is either a variable or a string constant. If the user specified no?r-exp, the values of variables that are referenced in ?expr will be printed upon theassertion failure.

cout . args

[Function]
Similar to cout << arguments << args, where argument can be any Scheme object.
If it’s a procedure (e.g. newline), it’s called without args rather than printed.

cerr . args

[Function]
Similar to cerr << arguments << args, where argument can be any Scheme object.
If it’s a procedure (e.g. newline), it’s called without args rather than printed.

7

7 (debugging time)
7.1 Overview
Defines a macro to time execution of a body of expressions. Each element is timed individually.

7.2 Usage
time args[Special Form]

syntax: (time expr1 expr2...)
Times the execution of a list of expressions, in milliseconds. The resolution is limited
to guile’s internal-time-units-per-second. Disregards the expressions’ return
value(s) (FIXME).

8

8 (graph topological-sort)
8.1 Overview
The algorithm is inspired by Cormen, Leiserson and Rivest (1990)‘‘Introduction to Algorithms’’, chapter 23.

8.2 Usage
topological-sort dag[Function]
Returns a list of the objects in the directed acyclic graph, dag, topologically sorted.
Objects are compared using equal?. The graph has the form:(list (obj1 . (dependents-of-obj1))(obj2 . (dependents-of-obj2)) ...)...specifying, for example, that obj1 must come before all the objects in(dependents-of-obj1) in the sort.

topological-sortq dag[Function]
Returns a list of the objects in the directed acyclic graph, dag, topologically sorted.
Objects are compared using eq?. The graph has the form:(list (obj1 . (dependents-of-obj1))(obj2 . (dependents-of-obj2)) ...)...specifying, for example, that obj1 must come before all the objects in(dependents-of-obj1) in the sort.

topological-sortv dag[Function]
Returns a list of the objects in the directed acyclic graph, dag, topologically sorted.
Objects are compared using eqv?. The graph has the form:(list (obj1 . (dependents-of-obj1))(obj2 . (dependents-of-obj2)) ...)...specifying, for example, that obj1 must come before all the objects in(dependents-of-obj1) in the sort.

99 (htmlprag)
9.1 Overview
HtmlPrag provides permissive HTML parsing capability to Scheme programs, which isuseful for software agent extraction of information from Web pages, for programmaticallytransforming HTML files, and for implementing interactive Web browsers. HtmlPrag emits“SHTML,” which is an encoding of HTML in [SXML], so that conventional HTML may
be processed with XML tools such as [SXPath] and [SXML-Tools]. Like [SSAX-HTML],
HtmlPrag provides a permissive tokenizer, but also attempts to recover structure. HtmlPragalso includes procedures for encoding SHTML in HTML syntax.
The HtmlPrag parsing behavior is permissive in that it accepts erroneous HTML, handling several classes of HTML syntax errors gracefully, without yielding a parse error. Thisis crucial for parsing arbitrary real-world Web pages, since many pages actually containsyntax errors that would defeat a strict or validating parser. HtmlPrag’s handling of errors
is intended to generally emulate popular Web browsers’ interpretation of the structure oferroneous HTML. We euphemistically term this kind of parse “pragmatic.” To disable thepragmatic behavior and parse HTML more rigidly, the %strict-tokenizer? parametercan be set to #true. In this mode of operation, one ended HTML tags will not be treatedspecially, for example, and their content will be coalesced. On the other side, valid HTMLwill parse more accurately. When working with HTML known to be valid, it makes sense
to use this mode of operation.
HtmlPrag also has some support for [XHTML], although XML namespace qualifiers[XML-Names] are currently accepted but stripped from the resulting SHTML. Note thatvalid XHTML input is of course better handled by a validating XML parser like [SSAX].
To receive notification of new versions of HtmlPrag, and to be polled for input on changes
to HtmlPrag being considered, ask the author to add you to the moderated, announce-only
email list, htmlprag-announce.
Thanks to Oleg Kiselyov and Kirill Lisovsky for their help with SXML.

9.2 Usage%default-parent-constraints%parent-constraints%strict-tokenizer?
shtml-comment-symbol
shtml-decl-symbol
shtml-empty-symbol
shtml-end-symbol
shtml-entity-symbol
shtml-named-char-id
shtml-numeric-char-id
shtml-pi-symbol[Variable][Variable][Variable][Variable][Variable][Variable][Variable][Variable][Variable][Variable][Variable]

Chapter 9: (htmlprag)

10

shtml-start-symbol[Variable]

shtml-text-symbol[Variable]

shtml-top-symbol[Variable]

html->shtml input [#:strict?][Function]

html->sxml input [#:strict?][Function]

html->sxml-0nf input [#:strict?][Function]

html->sxml-1nf input [#:strict?][Function]

html->sxml-2nf input [#:strict?][Function]

make-html-tokenizer in normalized?

[Function]parse-html/tokenizer tokenizer normalized? [#:strict?][Function]

shtml->html shtml[Function]

shtml-entity-value entity[Function]

shtml-token-kind token[Function]

sxml->html shtml[Function]

test-htmlprag[Function]

tokenize-html in normalized?

[Function]

write-shtml-as-html shtml out[Function]

write-sxml-html shtml out[Function]

11

10 (io string)
10.1 Overview
Procedures that do io with strings.

10.2 Usagefind-string-from-port? str <input-port> . max-no-char[Function]
Looks for str in <input-port>, optionally within the first max-no-char characters.

12

11 (logging logger)
11.1 Overview
This is a logging subsystem similar to the one in the python standard library. There are twomain concepts to understand when working with the logging modules. These are loggers
and log handlers.
Loggers

Loggers are the front end interfaces for program logging. They can be registeredby name so that no part of a program needs to be concerned with passing
around loggers. In addition, a default logger can be designated so that, formost applications, the program does not need to be concerned with logger
instances at all beyond the initial setup.
Log messages all flow through a logger. Messages carry with them a level(for example: ’WARNING, ’ERROR, ’CRITICAL), and loggers can filter out
messages on a level basis at runtime. This way, the amount of logging can beturned up during development and bug investigation, but turned back down on
stable releases.
Loggers depend on Log Handlers to actually get text to the log’s destination(for example, a disk file). A single Logger can send messages through multiple
Log Handlers, effectively multicasting logs to multiple destinations.

Log Handlers
Log Handlers actually route text to a destination. One or more handlers mustbe attached to a logger for any text to actually appear in a log.
Handlers apply a configurable transformation to the text so that it is formatted
properly for the destination (for instance: syslogs, or a text file). Like theloggers, they can filter out messages based on log levels. By using filters on
both the Logger and the Handlers, precise controls can be put on which log
messages go where, even within a single logger.

11.2 Example use of logger
Here is an example program that sets up a logger with two handlers. One handler sends thelog messages to a text log that rotates its logs. The other handler sends logs to standard
error, and has its levels set so that INFO and WARN-level logs don’t get through.
(use-modules (logging logger)(logging rotating-log)(logging port-log)(scheme documentation)(oop goops))---------------------------------------------------------------------Support functions---------------------------------------------------------------------(define (setup-logging)Chapter 11: (logging logger)(let ((lgr(rotating

(err

13

(make <logger>))(make <rotating-log>#:num-files 3#:size-limit 1024#:file-name "test-log-file"))(make <port-log> #:port (current-error-port))));; don’t want to see warnings or info on the screen!!
(disable-log-level! err ’WARN)(disable-log-level! err ’INFO);; add the handlers to our logger(add-handler! lgr rotating)(add-handler! lgr err);; make this the application’s default logger(set-default-logger! lgr)
(open-log! lgr)))(define (shutdown-logging)(flush-log);; since no args, it uses the default(close-log!) ;; since no args, it uses the default(set-default-logger! #f))---------------------------------------------------------------------Main code---------------------------------------------------------------------(setup-logging)Due to log levels, this will get to file,
but not to stderr(log-msg ’WARN "This is a warning.")
This will get to file AND stderr(log-msg ’CRITICAL "ERROR message!!!")(shutdown-logging)

11.3 Usage[Class]This is the base class for all of the log handlers, and encompasses the basic functionality that all handlers are expected to have. Keyword arguments recognized by the<log-handler> at creation time are:<log-handler>Chapter 11: (logging logger)

14#:formatter
This optional parameter must be a function that takes three arguments:
the log level, the time (as from current-time), and the log string itself.
The function must return a string representing the formatted log.
Here is an example invocation of the default formatter, and what its
output looks like:(default-log-formatter ’CRITICAL(current-time)"The servers are melting!")==> "2003/12/29 14:53:02 (CRITICAL): The servers are melting!"#:flush-on-emit?
This optional parameter defaults to #t, to ensure users can tail the logs
output in real time. In some cases, such as when logging very large output
to a file, it may be preferable to set this to #f, to let the default blockbuffering mode of the associated file port reduce write pressure on the filesystem.
[Generic]
emit-log handler str. This method should be implemented for all the handlers.
This sends a string to their output media. All level checking and formatting has
already been done by accept-log.

emit-log[Generic]
accept-log handler lvl time str. If lvl is enabled for handler, then str will beformatted and sent to the log via the emit-log method. flush-log is called after
emitting a log to ensure users tailing the source file can see new messages in real time.
source-properties is optional; it can be either #f or an association list containing
the file name, line, and column source information provided to the log-msg call.
Formatting is done via the formatting function given at handler’s creation time, orby the default if none was given.

accept-log

This method should not normally need to be overridden by subclasses. This methodshould not normally be called by users of the logging system. It is only exported sothat writers of log handlers can override this behavior.

accept-log[Method]

accept-log[Method][Class]This is the class that aggregates and manages log handlers. It also maintains theglobal information about which levels of log messages are enabled, and which havebeen suppressed. Keyword arguments accepted on creation are:<logger>#:handlers
This optional parameter must be a list of objects derived from<log-handler>. Handlers can always be added later via add-handler!
calls.

Chapter 11: (logging logger)

15[Generic]
add-handler! lgr handler. Adds handler to lgr’s list of handlers. All subsequentlogs will be sent through the new handler, as well as any previously registered handlers.

add-handler!

add-handler!

[Method][Generic]
log-msg [lgr] [source-properties] lvl arg1 arg2 .... Send a log message madeup of the display’ed representation of the given arguments. The log is generated at
level lvl, which should be a symbol. If the lvl is disabled, the log message is not
generated. Generated log messages are sent through each of lgr’s handlers.
If the lgr parameter is omitted, then the default logger is used, if one is set. If thesource-properties argument is provided, it should be a source property alist containing
the filename, line and column keys.
As the args are display’ed, a large string is built up. Then, the string is split atnewlines and sent through the log handlers as independent log messages. The reason
for this behavior is to make output nicer for log handlers that prepend information
like pid and timestamps to log statements.
;; logging to default logger, level of WARN
(log-msg ’WARN "Warning! " x " is bigger than " y "!!!")

log-msg;; looking up a logger and logging to it(let ((l (lookup-logger "main")))(log-msg l ’CRITICAL "FAILURE TO COMMUNICATE!")(log-msg l ’CRITICAL "ABORTING NOW"))

log-msg[Method]log-msg[Method]log-msg[Method]log-msg[Method]

set-default-logger! lgr[Function]
Sets the given logger, lgr, as the default for logging methods where a logger is not
given. lgr can be an instance of <logger>, a string that has been registered via
register-logger!, or #f to remove the default logger.
With this mechanism, most applications will never need to worry about logger registration or lookup.
;; example 1(set-default-logger! "main") ;; look up "main" logger and make it the default;; example 2(define lgr (make <logger>))(add-handler! lgr(make <port-handler>#:port (current-error-port)))(set-default-logger! lgr)Chapter 11: (logging logger)

16(log-msg ’CRITICAL "This is a message to the default logger!!!")(log-msg lgr ’CRITICAL "This is a message to a specific logger!!!")

register-logger! str lgr[Function]
Makes lgr accessible from other parts of the program by a name given in str. str
should be a string, and lgr should be an instance of class <logger>.
(define main-log (make <logger>))(define corba-log (make <logger>))(register-logger! "main" main-log)(register-logger! "corba" corba-log);; in a completely different part of the program....
(log-msg (lookup-logger "corba") ’WARNING "This is a corba warning.")

lookup-logger str[Function]
Looks up an instance of class <logger> by the name given in str. The string shouldhave already been registered via a call to register-logger!.

enable-log-level! lgr lvl[Function]
Enables a specific logging level given by the symbol lvl, such that messages at thatlevel will be sent to the log handlers. lgr can be of type <logger> or <log-handler>.
Note that any levels that are neither enabled or disabled are treated as enabled by thelogging system. This is so that misspelt level names do not cause a logging blackout.

disable-log-level! lgr lvl[Function]
Disables a specific logging level, such that messages at that level will not be sent to
the log handlers. lgr can be of type <logger> or <log-handler>.
Note that any levels that are neither enabled or disabled are treated as enabled by thelogging system. This is so that misspelt level names do not cause a logging blackout.
[Generic]
flush-log handler. Tells the handler to output any log statements it may havebuffered up. Handlers for which a flush operation doesn’t make sense can choose not
to implement this method. The default implementation just returns #t.

flush-log

flush-log[Method]flush-log[Method]flush-log[Method][Generic]
open-log! handler. Tells the handler to open its log. Handlers for which an open
operation doesn’t make sense can choose not to implement this method. The default
implementation just returns #t.

open-log!

open-log!

[Method]

open-log!

[Method]

open-log!

[Method]Chapter 11: (logging logger)

17[Generic]
open-log! handler. Tells the handler to close its log. Handlers for which a close
operation doesn’t make sense can choose not to implement this method. The default
implementation just returns #t.

close-log!

close-log!

[Method]close-log!

[Method]close-log!

[Method]18

12 (logging port-log)
12.1 Overview
This module defines a log handler that writes to an arbitrary port of the user’s choice. Usesof this handler could include:• Sending logs across a socket to a network log collector.
• Sending logs to the screen• Sending logs to a file
• Collecting logs in memory in a string port for later use

12.2 Usage[Class]<port-log>
This is a log handler which writes logs to a user-provided port.
Keywords recognized by <port-log> on creation are:#:portThis is the port to which the log handler will write.

#:formatter
Allows the user to provide a function to use as the log formatter for thishandler. See [logging logger <log-handler>], page 13, for details.
Example of creating a <port-log>:(make <port-log> #:port (current-error-port))

19

13 (logging rotating-log)
13.1 Overview
This module defines a log handler for text logs that rotate when they get to be a user-definedsize. This is similar to the behavior of many UNIX standard log files. See Chapter 11[logging logger], page 12, for more information in general on log handlers.

13.2 Usage[Class]This is a log handler which writes text logs that rotate when they reach a configurable
size limit.
Keywords recognized by <rotating-log> on creation are:<rotating-log>#:num-files
This is the number of log files you want the logger to use. Default is 4.
#:size-limit
This is the size, in bytes, a log file must get before the logs get rotated.
Default is 1MB (104876 bytes).
#:file-nameThis is the base of the log file name. Default is “logfile”. Numbers will
be appended to the file name representing the log number. The newest
log file is always “NAME.1”.
#:formatter
Allows the user to provide a function to use as the log formatter for thishandler. See [logging logger <log-handler>], page 13, for details.
Example of creating a <rotating-log>:(make <rotating-log>#:num-files 3#:size-limit 1024#:file-name "test-log-file"))20

14 (match-bind)14.1 Overview
Utility functions and syntax constructs for dealing with regular expressions in a concise
manner. Will be submitted to Guile for inclusion.

14.2 Usage[Special Form]
Match a string against a regular expression, binding lexical variables to the various
parts of the match.
vars is a list of names to which to bind the parts of the match. The first variable ofthe list will be bound to the entire match, so the number of variables needed will beequal to the number of open parentheses (‘(’) in the pattern, plus one for the wholematch.
consequent is executed if the given expression str matches regex. If the string does
not match, alternate will be executed if present. If alternate is not present, the resultof match-bind is unspecified.
Here is a short example:(define (star-indent line)"Returns the number of spaces until the firststar (‘*’) in the input, or #f if the firstnon-space character is not a star."(match-bind "^( *)\*.*$" line (_ spaces)(string-length spaces)#f))match-bind compiles the regular expression regex at macro expansion time. For thisreason, regex must be a string literal, not an arbitrary expression.

match-binds/// pat subst[Function]
Make a procedure that performs perl-like regular expression search-and-replace on an
input string.
The regular expression pattern pat is in the standard regular expression syntax accepted by make-regexp. The substitution string is very similar to perl’s s/// operator. Backreferences are indicated with a dollar sign (‘$’), and characters can beescaped with the backslash.
s/// returns a procedure of one argument, the input string to be matched. If thestring matches the pattern, it will be returned with the first matching segment replaced as per the substitution string. Otherwise the string will be returned unmodified.
Here are some examples:((s/// "foo" "bar") "foo bar baz qux foo")⇒ "bar bar baz qux foo"Chapter 14: (match-bind)21((s/// "zag" "bar") "foo bar baz qux foo")⇒ "foo bar baz qux foo"((s/// "(f(o+)) (zag)?" "$1 $2 $3")
"foo bar baz qux foo")⇒ "foo oo bar baz qux foo"s///g pat subst[Function]
Make a procedure that performs perl-like global search-and-replace on an input string.
The pat and subst arguments are as in the non-global s///. See [s///], page 20, formore information.
s///g differs from s/// in that it does a global search and replace, not stopping at
the first match.

22

15 (math minima)
15.1 Overview
This module contains functions for computing the minimum values of mathematical expressions on an interval.

15.2 Usage
golden-section-search f x0 x1 prec

[Function]
The Golden Section Search algorithm finds minima of functions which are expensive tocompute or for which derivatives are not available. Although optimum for the generalcase, convergence is slow, requiring nearly 100 iterations for the example (x^3-2x-5).
If the derivative is available, Newton-Raphson is probably a better choice. If thefunction is inexpensive to compute, consider approximating the derivative.
x0 and x1 are real numbers. The (single argument) procedure func is unimodal over
the open interval (x0, x1). That is, there is exactly one point in the interval for which
the derivative of func is zero.
It returns a pair (x . func(x)) where func(x) is the minimum. The prec parameter isthe stop criterion. If prec is a positive number, then the iteration continues until x is
within prec from the true value. If prec is a negative integer, then the procedure will
iterate -prec times or until convergence. If prec is a procedure of seven arguments, x0,
x1, a, b, fa, fb, and count, then the iterations will stop when the procedure returns#t.
Analytically, the minimum of x^3-2x-5 is 0.816497.
(define func (lambda (x) (+ (* x (+ (* x x) -2)) -5)))(golden-section-search func 0 1 (/ 10000))==> (816.4883855245578e-3 . -6.0886621077391165)(golden-section-search func 0 1 -5)==> (819.6601125010515e-3 . -6.088637561916407)(golden-section-search func 0 1(lambda (a b c d e f g ) (= g 500)))==> (816.4965933140557e-3 . -6.088662107903635)

23

16 (math primes)
16.1 Overview
This module defines functions related to prime numbers, and prime factorization.

16.2 Usage[Variable]
This is the maximum number of iterations of Solovay-Strassen that will be done totest a number for primality. The chance of error (a composite being labelled prime)is (expt 2 (- prime:trials)).

prime:trials

prime? n[Function]
Returns #f if n is composite, and t if it is prime. There is a slight chance, (expt 2(- prime:trials)), that a composite will return #t.

prime> start[Function]
Return the first prime number greater than start. It doesn’t matter if start is prime
or composite.

primes> start count[Function]

Returns a list of the first count prime numbers greater than start.

prime< start[Function]
Return the first prime number less than start. It doesn’t matter if start is prime orcomposite. If no primes are less than start, #f will be returned.

primes< start count[Function]
Returns a list of the first count prime numbers less than start. If there are fewer thancount prime numbers less than start, then the returned list will have fewer than startelements.

factor k[Function]
Returns a list of the prime factors of k. The order of the factors is unspecified. Inorder to obtain a sorted list do (sort! (factor k) <).

24

17 (os process)17.1 Overview
This is a library for execution of other programs from Guile. It also allows communication
using pipes (or a pseudo terminal device, but that’s not currently implemented). This codeoriginates in the (goosh) modules, which itself was part of goonix in one of Guile’s past
lives.
The following will hold when starting programs:
1. If the name of the program does not contain a / then the directories listed in the current
PATH environment variable are searched to locate the program.
2. Unlike for the corresponding primitive exec procedures, e.g., execlp, the name of the
program can not be set independently of the path to execute: the zeroth and firstmembers of the argument vector are combined into one.
All symbols exported with the prefix os:process: are there in support of macros that
use them. They should be ignored by users of this module.

17.2 Usage
os:process:pipe-fork-child[Special Form]run+ args[Special Form]
Evaluate an expression in a new foreground process and wait for its completion.
If no connection terms are specified, then all ports except current-input-port,
current-output-port and current-error-port will be closed in the new process.
The file descriptors underlying these ports will not be changed.
The value returned is the exit status from the new process as returned by the waitpid
procedure.
The keywords and connections arguments are optional: see run-concurrently+,which is documented below. The #:foreground keyword is implied.
(run+ (begin (write (+ 2 2)) (newline) (quit 0)))(run+ (tail-call-program "cat" "/etc/passwd"))

run-concurrently+ args

[Special Form]
Evaluate an expression in a new background process. If no connection terms are
specified, then all ports except current-input-port, current-output-port andcurrent-error-port will be closed in the new process. The file descriptors underlying these ports will not be changed.
The value returned in the parent is the pid of the new process.
When the process terminates its exit status can be collected using the waitpid procedure.
Keywords can be specified before the connection list:#:slave causes the new process to be put into a new session. If current-input-port(after redirections) is a tty it will be assigned as the controlling terminal. This option
is used when controlling a process via a pty.

Chapter 17: (os process)25#:no-auto-close prevents the usual closing of ports which occurs by default.
#:foreground makes the new process the foreground job of the controlling terminal,
if the current process is using job control. (not currently implemented). The default
is to place it into the background
The optional connection list can take several forms:(port) usually specifies that a given port not be closed. However if #:no-auto-close
is present it specifies instead a port which should be closed.
(port 0) specifies that a port be moved to a given file descriptor (e.g., 0) in the newprocess. The order of the two components is not significant, but one must be a number
and the other must evaluate to a port. If the file descriptor is one of the standard set(0, 1, 2) then the corresponding standard port (e.g., current-input-port) will be
set to the specified port.
Example:(let ((p (open-input-file "/etc/passwd")))(run-concurrently+ (tail-call-program "cat") (p 0)))

tail-call-pipeline args

[Special Form]
Replace the current process image with a pipeline of connected processes.
The expressions in the pipeline are run in new background processes. The foregroundprocess waits for them all to terminate. The exit status is derived from the statusof the process at the tail of the pipeline: its exit status if it terminates normally,otherwise 128 plus the number of the signal that caused it to terminate.
The signal handlers will be reset and file descriptors set up as for tail-call-program.
Like tail-call-program it does not close open ports or flush buffers.
Example:(tail-call-pipeline ("ls" "/etc") ("grep" "passwd"))

tail-call-pipeline+ args

[Special Form]
Replace the current process image with a pipeline of connected processes.
Each process is specified by an expression and each pair of processes has a connection
list with pairs of file descriptors. E.g., ((1 0) (2 0)) specifies that file descriptors 1
and 2 are to be connected to file descriptor 0. This may also be written as ((1 2 0)).
The expressions in the pipeline are run in new background processes. The foregroundprocess waits for them all to terminate. The exit status is derived from the statusof the process at the tail of the pipeline: its exit status if it terminates normally,otherwise 128 plus the number of the signal that caused it to terminate.
The signal handlers will be reset and file descriptors set up as for tail-call-program.
Like tail-call-program it does not close open ports or flush buffers.
Example:(tail-call-pipeline+ (tail-call-program "ls" "/etc") ((1 0))(tail-call-program "grep" "passwd"))

os:process:new-comm-pipes old-pipes out-conns
os:process:pipe-make-commands fdes port portvar
os:process:pipe-make-redir-commands connections portvar[Function][Function][Function]

Chapter 17: (os process)os:process:setup-redirected-port port fdes

26

[Function]

run prog . args

[Function]
Execute prog in a new foreground process and wait for its completion. The value
returned is the exit status of the new process as returned by the waitpid procedure.

Example:(run "cat" "/etc/passwd")

run-concurrently . args

[Function]
Start a program running in a new background process. The value returned is the pidof the new process.
When the process terminates its exit status can be collected using the waitpid procedure.
Example:(run-concurrently "cat" "/etc/passwd")

run-with-pipe mode prog . args

[Function]
Start prog running in a new background process. The value returned is a pair: theCAR is the pid of the new process and the CDR is either a port or a pair of ports (withthe CAR containing the input port and the CDR the output port). The port(s) canbe used to read from the standard output of the process and/or write to its standard
input, depending on the mode setting. The value of mode should be one of "r", "w"or "r+".
When the process terminates its exit status can be collected using the waitpid procedure.
Example:(use-modules (ice-9 rdelim)) ; needed by read-line(define catport (cdr (run-with-pipe "r" "cat" "/etc/passwd")))(read-line catport)

tail-call-program prog . args

[Function]
Replace the current process image by executing prog with the supplied list of arguments, args.

This procedure will reset the signal handlers and attempt to set up file descriptors as
follows:
1. File descriptor 0 is set from (current-input-port).
2. File descriptor 1 is set from (current-output-port).
3. File descriptor 2 is set from (current-error-port).
If a port can not be used (e.g., because it’s closed or it’s a string port) then the filedescriptor is opened on the file specified by *null-device* instead.
Note that this procedure does not close any ports or flush output buffers. Successfully
executing prog will prevent the normal flushing of buffers that occurs when Guileterminates. Doing otherwise would be incorrect after forking a child process, since
the buffers would be flushed in both parent and child.

Chapter 17: (os process)

Examples:(tail-call-program "cat" "/etc/passwd")(with-input-from-file "/etc/passwd"(lambda ()(tail-call-program "cat")))

27

28

18 (scheme documentation)
18.1 Overview
Defines some macros to help in documenting macros, variables, generic functions, andclasses.

18.2 Usagedefine-macro-with-docs args

[Special Form]Define a macro with documentation.

define-with-docs args

[Special Form]Define a variable with documentation.

define-generic-with-docs args

[Special Form]Define a generic function with documentation.

define-class-with-docs args
Define a class with documentation.

[Special Form]

29

19 (scheme kwargs)
19.1 Overview
Support for defining functions that take python-like keyword arguments. In one of his earlytalks, Paul Graham wrote about a large system called "Rtml":
Most of the operators in Rtml were designed to take keyword parameters, andwhat a help that turned out to be. If I wanted to add another dimension to the
behavior of one of the operators, I could just add a new keyword parameter,
and everyone’s existing templates would continue to work. A few of the Rtml
operators didn’t take keyword parameters, because I didn’t think I’d ever needto change them, and almost every one I ended up kicking myself about later. If
I could go back and start over from scratch, one of the things I’d change would
be that I’d make every Rtml operator take keyword parameters.
See [lambda/kwargs], page 29, for documentation and examples.
See Section “Optional Arguments” in Guile Reference Manual, for more information on
Guile’s standard support for optional and keyword arguments. Quote taken from http://lib.store.yahoo.net/lib/paulgraham/bbnexcerpts.txt.

19.2 Usagedefine/kwargs args

[Special Form]Defines a function that takes kwargs. See [scheme kwargs lambda/kwargs], page 29,
for more information.

lambda/kwargs args

[Special Form]Defines a function that takes keyword arguments.
bindings is a list of bindings, each of which may either be a symbol or a two-element
symbol-and-default-value list. Symbols without specified default values will default
to #f.
For example:(define frobulate (lambda/kwargs (foo (bar 13) (baz 42))
(list foo bar baz)))(frobulate) ⇒ (#f 13 42)(frobulate #:baz 3) ⇒ (#f 13 3)(frobulate #:foo 3) ⇒ (3 13 42)(frobulate 3 4) ⇒ (3 4 42)(frobulate 1 2 3) ⇒ (1 2 3)
(frobulate #:baz 2 #:bar 1) ⇒ (#f 1 2)
(frobulate 10 20 #:foo 3) ⇒ (3 20 42)
This function differs from the standard lambda* provided by Guile in that invoking
the function will accept positional arguments. As an example, the lambda/kwargs
behaves more intuitively in the following case:((lambda* (#:optional (bar 42) #:key (baz 73))
(list bar baz))Chapter 19: (scheme kwargs)

30

1 2) ⇒ (1 73)((lambda/kwargs ((bar 42) (baz 73))
(list bar baz))1 2) ⇒ (1 2)
The fact that lambda* accepts the extra ‘2’ argument is probably just a bug. In any
case, lambda/kwargs does the right thing.

31

20 (search basic)
20.1 Overview
This module has the classic search functions in it.

20.2 Usage
depth-first-search init done? expander[Function]
Performs a depth-first search from initial state init. It will return the first state itsees for which predicate done? returns #t. It will use function expander to get a listof all states reacheable from a given state.
init can take any form the user wishes. This function treats it as opaque data to pass
to done? and expander.
done? takes one argument, of the same type as init, and returns either #t or #f.
expander takes one argument, of the same type as init, and returns a list of statesthat can be reached from there.

breadth-first-search init done? expander[Function]
Performs a breadth-first search from initial state init. It will return the first state itsees for which predicate done? returns #t. It will use function expander to get a listof all states reacheable from a given state.
init can take any form the user wishes. This function treats it as opaque data to pass
to done? and expander.
done? takes one argument, of the same type as init, and returns either #t or #f.
expander takes one argument, of the same type as init, and returns a list of statesthat can be reached from there.

binary-search-sorted-vector vec target [cmp] [default][Function]
Searches a sorted vector vec for item target. A binary search is employed whichshould find an item in O(log n) time if it is present. If target is found, the index into
vec is returned.
As part of the search, the function cmp is applied to determine whether a vector item
is less than, greater than, or equal to the target. If target cannot be found in thevector, then default is returned.
cmp defaults to -, which gives a correct comparison for vectors of numbers. default
will be #f if another value is not given.
(binary-search-sorted-vector #(10 20 30) 20) ⇒ 1

32

21 (string completion)
21.1 Overview
This module provides a facility that can be used to implement features such as TABcompletion in programs. A class <string-completer> tracks all the potential complete
strings. Here is an example usage.
(use-modules (string completion)(oop goops)(srfi srfi-11));; for the (let-values)(define c (make <string-completer>))(add-strings! c "you your yourself yourselves")(let-values (((completions expansion exact? unique?) (complete c "yours")))(display completions)(newline)(display expansion) (newline)(display exact?)(newline)(display unique?)(newline))==> ("yourself" "yourselves")"yoursel"#f#f
There are several more options for usage, which are detailed in the class and method
documentation.

21.2 Usage[Class]This is the class that knows what the possible expansions are, and can determine thecompletions of given partial strings. The following are the recognized keywords onthe call to make:<string-completer>#:strings
This gives the completer an initial set of strings. It is optional, and the
add-strings! method can add strings to the completer later, whether
these initial strings were given or not. The strings that follow this keyword
can take any form that the add-strings! method can take (see below).
#:case-sensitive?
This is a boolean that directs the completer to do its comparisons ina case sensiteve way or not. The default value is #t, for case-sensitive
behavior.

case-sensitive-completion?
case-sensitive-completion? completer.
case-sensitive, and #f otherwise.

[Generic]
Returns #t if the completer isChapter 21: (string completion)

case-sensitive-completion?

33[Method][Generic]
add-strings! completer strings. Adds the given strings to the set of possible
comletions known to completer. strings can either be a list of strings, or a single
string of words separated by spaces. The order of the words given is not important.

add-strings!

[Method]add-strings!
all-completions completer str[Function]
Returns a list of all possible completions for the given string str. The returned list
will be in alphabetical order.
Note that users wanting to customize the completion algorithm can subclass<string-completer> and override this method.

[Generic]
complete completer str. Accepts a string, str, and returns four values via a values
call. These are:completecompletions
This is the same list that would be returned from a call to
all-completions.
expansion This is the longest string that would have returned identical results. In
other words, this is what most programs replace your string with when
you press TAB once. This value will be equal to str if there were no
known completionss.
("wonders" "wonderment" "wondering")
completed against "won" yields an expansionof "wonder"
exact?

This will be #t if the returned expansion is an exact match of one of thepossible completions.

unique?

This will be #t if there is only one possible completion. Note that when
unique? is #t, then exact? will also be #t.

complete[Method]34

22 (string soundex)
22.1 Overview
Soundex algorithm, taken from Knuth, Vol. 3 “Sorting and searching”, pp 391–2

22.2 Usagesoundex name

[Function]
Performs the original soundex algorithm on the input name. Returns the encoded
string. The idea is for similar sounding sames to end up with the same encoding.
(soundex "Aiza")=> "A200"(soundex "Aisa")=> "A200"(soundex "Aesha")=> "A200"

35

23 (string transform)
23.1 Overview
Module ‘(string transform)’ provides functions for modifying strings beyond that which
is provided in the guile core and ‘(srfi srfi-13)’.

23.2 Usage
escape-special-chars str special-chars escape-char[Function]
Returns a copy of str with all given special characters preceded by the given escapechar.
special-chars can either be a single character, or a string consisting of all the special
characters.
;; make a string regexp-safe...
(escape-special-chars "***(Example String)***""[]()/*."#\\)=> "\\*\\*\\*\\(Example String\\)\\*\\*\\*";; also can escape a singe char...
(escape-special-chars "richardt@vzavenue.net"#\@#\@)=> "richardt@@vzavenue.net"

transform-string str match? replace [start] [end][Function]
Uses match? against each character in str, and performs a replacement on each character for which matches are found.
match? may either be a function, a character, a string, or #t. If match? is a function,then it takes a single character as input, and should return ‘#t’ for matches. match?
is a character, it is compared to each string character using char=?. If match? is astring, then any character in that string will be considered a match. #t will cause
every character to be a match.
If replace is a function, it is called with the matched character as an argument, andthe returned value is sent to the output string via ‘display’. If replace is anythingelse, it is sent through the output string via ‘display’.
Note that te replacement for the matched characters does not need to be a single
character. That is what differentiates this function from ‘string-map’, and whatmakes it useful for applications such as converting ‘#\&’ to ‘"&amp;"’ in web pagetext. Some other functions in this module are just wrappers around common uses of‘transform-string’. Transformations not possible with this function should probably be done with regular expressions.
If start and end are given, they control which portion of the string undergoes transformation. The entire input string is still output, though. So, if start is ‘5’, then thefirst five characters of str will still appear in the returned string.

Chapter 23: (string transform)

36; these two are equivalent...
(transform-string str #\space #\-) ; change all spaces to -’s(transform-string str (lambda (c) (char=? #\space c)) #\-)

expand-tabs str [tab-size][Function]
Returns a copy of str with all tabs expanded to spaces. tab-size defaults to 8.
Assuming tab size of 8, this is equivalent to:(transform-string str #\tab "")center-string str [width] [chr] [rchr][Function]
Returns a copy of str centered in a field of width characters. Any needed padding
is done by character chr, which defaults to ‘#\space’. If rchr is provided, then thepadding to the right will use it instead. See the examples below. left and rchr on theright. The default width is 80. The default lchr and rchr is ‘#\space’. The string isnever truncated.
(center-string "Richard Todd" 24)=> "Richard Todd"
(center-string " Richard Todd " 24 #\=)=> "===== Richard Todd ====="(center-string " Richard Todd " 24 #\< #\>)=> "<<<<< Richard Todd >>>>>"

left-justify-string str [width] [chr][Function]
left-justify-string str [width chr]. Returns a copy of str padded with chr suchthat it is left justified in a field of width characters. The default width is 80. Unlike‘string-pad’ from srfi-13, the string is never truncated.

right-justify-string str [width] [chr][Function]
Returns a copy of str padded with chr such that it is right justified in a field ofwidth characters. The default width is 80. The default chr is ‘#\space’. Unlike‘string-pad’ from srfi-13, the string is never truncated.

collapse-repeated-chars str [chr] [num][Function]
Returns a copy of str with all repeated instances of chr collapsed down to at mostnum instances. The default value for chr is ‘#\space’, and the default value for num
is 1.
(collapse-repeated-chars "H e l l o")=> "H e l l o"(collapse-repeated-chars "H--e--l--l--o" #\-)=> "H-e-l-l-o"(collapse-repeated-chars "H-e--l---l----o" #\- 2)=> "H-e--l--l--o"37

24 (string wrap)
24.1 Overview
Module ‘(string wrap)’ provides functions for formatting text strings such that they fill agiven width field. A class, <text-wrapper>, does the work, but two convenience methods
create instances of it for one-shot use, and in the process make for a more “schemey”
interface. If many strings will be formatted with the same parameters, it might be better
performance-wise to create and use a single <text-wrapper>.

24.2 Usage[Class]This class encapsulates the parameters needing to be fed to the text wrapping algorithm. The following are the recognized keywords on the call to make:<text-wrapper>#:line-widthThis is the target length used when deciding where to wrap lines. Default
is 80.
#:expand-tabs?
Boolean describing whether tabs in the input should be expanded. Default is #t.
#:tab-width
If tabs are expanded, this will be the number of spaces to which they
expand. Default is 8.
#:collapse-whitespace?
Boolean describing whether the whitespace inside the existing text should
be removed or not. Default is #t.
If text is already well-formatted, and is just being wrapped to fit in adifferent width, then setting this to ‘#f’. This way, many common text
conventions (such as two spaces between sentences) can be preserved if in
the original text. If the input text spacing cannot be trusted, then leavethis setting at the default, and all repeated whitespace will be collapsed
down to a single space.
#:initial-indent
Defines a string that will be put in front of the first line of wrapped text.
Default is the empty string, “”.
#:subsequent-indent
Defines a string that will be put in front of all lines of wrapped text,
except the first one. Default is the empty string, “”.
#:break-long-words?
If a single word is too big to fit on a line, this setting tells the wrapper
what to do. Defaults to #t, which will break up long words. When set
to #f, the line will be allowed, even though it is longer than the defined#:line-width.

Chapter 24: (string wrap)

38

Here’s an example of creating a <text-wrapper>:(make <text-wrapper> #:line-width 48 #:break-long-words? #f)[Generic]
fill-string str keywds .... Wraps the text given in string str according to theparameters provided in keywds, or the default setting if they are not given. Returns
a single string with the wrapped text. Valid keyword arguments are discussed withthe <text-wrapper> class.
fill-string tw str. fills str using the instance of <text-wrapper> given as tw.

fill-string

fill-string[Method]

fill-string[Method][Generic]
string->wrapped-lines str keywds .... Wraps the text given in string str according to the parameters provided in keywds, or the default setting if they are not given.
Returns a list of strings representing the formatted lines. Valid keyword arguments
are discussed with the <text-wrapper> class.
string->wrapped-lines tw str. Wraps the text given in string str according to thegiven <text-wrapper> tw. Returns a list of strings representing the formatted lines.
Valid keyword arguments are discussed with the <text-wrapper> class.

string->wrapped-lines

string->wrapped-lines[Method]string->wrapped-lines[Method]39

25 (term ansi-color)25.1 Overview
The ‘(term ansi-color)’ module generates ANSI escape sequences for colors. Here is an
example of the module’s use:method one: safer, since you know the colors
will get reset(display (colorize-string "Hello!\n" ’RED ’BOLD ’ON-BLUE))
method two: insert the colors by hand(for-each display(list (color ’RED ’BOLD ’ON-BLUE)"Hello!"(color ’RESET)))

25.2 Usage
color . lst[Function]
Returns a string containing the ANSI escape sequence for producing the requested
set of attributes.
The allowed values for the attributes are listed below. Unknown attributes are ignored.
Reset Attributes‘CLEAR’ and ‘RESET’ are allowed and equivalent.
Non-Color Attributes‘BOLD’ makes text bold, and ‘DARK’ reverses this. ‘UNDERLINE’ and‘UNDERSCORE’ are equivalent. ‘BLINK’ makes the text blink. ‘REVERSE’
invokes reverse video.
‘CONCEALED’ hides output (as for getting
passwords, etc.).
Foregrond Color Attributes‘BLACK’, ‘RED’, ‘GREEN’, ‘YELLOW’, ‘BLUE’, ‘MAGENTA’, ‘CYAN’, ‘WHITE’

Background Color Attributes‘ON-BLACK’, ‘ON-RED’, ‘ON-GREEN’, ‘ON-YELLOW’, ‘ON-BLUE’, ‘ON-MAGENTA’,‘ON-CYAN’, ‘ON-WHITE’colorize-string str . color-list[Function]
Returns a copy of str colorized using ANSI escape sequences according to the attributes specified in color-list. At the end of the returned string, the color attributes
will be reset such that subsequent output will not have any colors in effect.
The allowed values for the attributes are listed in the documentation for the color
function.

40

26 (unit-test)
26.1 Overview
26.2 Usageassert-equal expected got[Function]

assert-true got[Function]

assert-false got[Function]

assert-numeric-= expected got precision[Function]<test-result>[Class]tests-run[Generic]

tests-run[Method]

tests-failed[Generic]

tests-failed[Method]

tests-log[Generic]

tests-log[Method]

failure-messages[Generic]

failure-messages[Method]

test-started[Generic]

test-started[Method]

test-failed[Generic]

test-failed[Method]summary[Generic]

summary[Method]<test-case>[Class]name[Generic]

name[Method]

name[Method]

set-up-test[Generic]

set-up-test[Method]tear-down-test[Generic]

tear-down-test[Method]run[Generic]run[Method]Chapter 26: (unit-test)

run<test-suite>

41[Method][Class]tests[Generic]

tests[Method]

add[Generic]

add[Method]

add[Method]

run-all-defined-test-cases[Function]

exit-with-summary result[Function]

assert[Special Form]assert-exception[Special Form]

42

Appendix A Copying This ManualThis manual is covered under the GNU Free Documentation License. A copy of the FDL
is provided here.

A.1 GNU Free Documentation License
Version 1.2, November 2002
Copyright c 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copiesof this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other functional anduseful document free in the sense of freedom: to assure everyone the effective freedom
to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible for modifications
made by others.
This License is a kind of “copyleft”, which means that derivative works of the document
must themselves be free in the same sense. It complements the GNU General Public
License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because
free software needs free documentation: a free program should come with manuals
providing the same freedoms that the software does. But this License is not limited tosoftware manuals; it can be used for any textual work, regardless of subject matter orwhether it is published as a printed book. We recommend this License principally forworks whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONSThis License applies to any manual or other work, in any medium, that contains a
notice placed by the copyright holder saying it can be distributed under the termsof this License. Such a notice grants a world-wide, royalty-free license, unlimited in
duration, to use that work under the conditions stated herein. The “Document”,
below, refers to any such manual or work. Any member of the public is a licensee, andis addressed as “you”. You accept the license if you copy, modify or distribute the workin a way requiring permission under copyright law.
A “Modified Version” of the Document means any work containing the Document or
a portion of it, either copied verbatim, or with modifications and/or translated intoanother language.
A “Secondary Section” is a named appendix or a front-matter section of the Documentthat deals exclusively with the relationship of the publishers or authors of the Document
to the Document’s overall subject (or to related matters) and contains nothing that
could fall directly within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any mathematics.) The

Appendix A: Copying This Manual

43

relationship could be a matter of historical connection with the subject or with related
matters, or of legal, commercial, philosophical, ethical or political position regardingthem.
The “Invariant Sections” are certain Secondary Sections whose titles are designated, as
being those of Invariant Sections, in the notice that says that the Document is released
under this License. If a section does not fit the above definition of Secondary then it is
not allowed to be designated as Invariant. The Document may contain zero Invariant
Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-CoverTexts or Back-Cover Texts, in the notice that says that the Document is released under
this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented
in a format whose specification is available to the general public, that is suitable forrevising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing
editor, and that is suitable for input to text formatters or for automatic translation toa variety of formats suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has been arranged tothwart or discourage subsequent modification by readers is not Transparent. An image
format is not Transparent if used for any substantial amount of text. A copy that is
not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ascii without
markup, Texinfo input format, LaTEX input format, SGML or XML using a publicly
available DTD, and standard-conforming simple HTML, PostScript or PDF designed
for human modification. Examples of transparent image formats include PNG, XCF
and JPG. Opaque formats include proprietary formats that can be read and edited
only by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the machine-generated HTML,PostScript or PDF produced by some word processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself, plus such following
pages as are needed to hold, legibly, the material this License requires to appear in thetitle page. For works in formats which do not have any title page as such, “Title Page”
means the text near the most prominent appearance of the work’s title, preceding the
beginning of the body of the text.
A section “Entitled XYZ” means a named subunit of the Document whose title either
is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in
another language. (Here XYZ stands for a specific section name mentioned below, suchas “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve
the Title” of such a section when you modify the Document means that it remains asection “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that
this License applies to the Document. These Warranty Disclaimers are considered to
be included by reference in this License, but only as regards disclaiming warranties:

Appendix A: Copying This Manual44

any other implication that these Warranty Disclaimers may have is void and has noeffect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or
noncommercially, provided that this License, the copyright notices, and the license
notice saying this License applies to the Document are reproduced in all copies, andthat you add no other conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further copying of the copies
you make or distribute. However, you may accept compensation in exchange for copies.
If you distribute a large enough number of copies you must also follow the conditions
in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly
display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have printed covers) of
the Document, numbering more than 100, and the Document’s license notice requires
Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, allthese Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify you as the publisherof these copies. The front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve the title of theDocument and satisfy these conditions, can be treated as verbatim copying in otherrespects.
If the required texts for either cover are too voluminous to fit legibly, you should put
the first ones listed (as many as fit reasonably) on the actual cover, and continue therest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100,
you must either include a machine-readable Transparent copy along with each Opaquecopy, or state in or with each Opaque copy a computer-network location from which
the general network-using public has access to download using public-standard network
protocols a complete Transparent copy of the Document, free of added material. If
you use the latter option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this Transparent copy willremain thus accessible at the stated location until at least one year after the last time
you distribute an Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the Document wellbefore redistributing any large number of copies, to give them a chance to provide youwith an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the conditionsof sections 2 and 3 above, provided that you release the Modified Version under precisely
this License, with the Modified Version filling the role of the Document, thus licensing

Appendix A: Copying This Manual

45

distribution and modification of the Modified Version to whoever possesses a copy of
it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct from that of theDocument, and from those of previous versions (which should, if there were any,
be listed in the History section of the Document). You may use the same title asa previous version if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities responsible forauthorship of the modifications in the Modified Version, together with at least fiveof the principal authors of the Document (all of its principal authors, if it has fewer
than five), unless they release you from this requirement.
C. State on the Title page the name of the publisher of the Modified Version, as the
publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications adjacent to the othercopyright notices.
F. Include, immediately after the copyright notices, a license notice giving the public
permission to use the Modified Version under the terms of this License, in the formshown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections and required CoverTexts given in the Document’s license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item
stating at least the title, year, new authors, and publisher of the Modified Version
as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document
as given on its Title Page, then add an item describing the Modified Version as
stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for public access toa Transparent copy of the Document, and likewise the network locations given in
the Document for previous versions it was based on. These may be placed in the“History” section. You may omit a network location for a work that was publishedat least four years before the Document itself, or if the original publisher of theversion it refers to gives permission.
K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Titleof the section, and preserve in the section all the substance and tone of each of thecontributor acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered in their text andin their titles. Section numbers or the equivalent are not considered part of thesection titles.
M. Delete any section Entitled “Endorsements”. Such a section may not be includedin the Modified Version.
N. Do not retitle any existing section to be Entitled “Endorsements” or to conflict intitle with any Invariant Section.
O. Preserve any Warranty Disclaimers.

Appendix A: Copying This Manual

46

If the Modified Version includes new front-matter sections or appendices that qualify
as Secondary Sections and contain no material copied from the Document, you may atyour option designate some or all of these sections as invariant. To do this, add theirtitles to the list of Invariant Sections in the Modified Version’s license notice. These
titles must be distinct from any other section titles.
You may add a section Entitled “Endorsements”, provided it contains nothing but
endorsements of your Modified Version by various parties—for example, statements ofpeer review or that the text has been approved by an organization as the authoritative
definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up
to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified
Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be
added by (or through arrangements made by) any one entity. If the Document alreadyincludes a cover text for the same cover, previously added by you or by arrangement
made by the same entity you are acting on behalf of, you may not add another; but
you may replace the old one, on explicit permission from the previous publisher that
added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission
to use their names for publicity for or to assert or imply endorsement of any Modified
Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this License,
under the terms defined in section 4 above for modified versions, provided that you
include in the combination all of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your combined work in its license
notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identicalInvariant Sections may be replaced with a single copy. If there are multiple Invariant
Sections with the same name but different contents, make the title of each such section
unique by adding at the end of it, in parentheses, the name of the original author or
publisher of that section if known, or else a unique number. Make the same adjustment
to the section titles in the list of Invariant Sections in the license notice of the combinedwork.
In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any
sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You
must delete all sections Entitled “Endorsements.”
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents released
under this License, and replace the individual copies of this License in the various
documents with a single copy that is included in the collection, provided that you
follow the rules of this License for verbatim copying of each of the documents in allother respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted

Appendix A: Copying This Manual

47

document, and follow this License in all other respects regarding verbatim copying ofthat document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate and independent
documents or works, in or on a volume of a storage or distribution medium, is called
an “aggregate” if the copyright resulting from the compilation is not used to limit thelegal rights of the compilation’s users beyond what the individual works permit. When
the Document is included in an aggregate, this License does not apply to the otherworks in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document,
then if the Document is less than one half of the entire aggregate, the Document’s CoverTexts may be placed on covers that bracket the Document within the aggregate, or theelectronic equivalent of covers if the Document is in electronic form. Otherwise theymust appear on printed covers that bracket the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may distribute translationsof the Document under the terms of section 4. Replacing Invariant Sections withtranslations requires special permission from their copyright holders, but you may
include translations of some or all Invariant Sections in addition to the original versionsof these Invariant Sections. You may include a translation of this License, and all thelicense notices in the Document, and any Warranty Disclaimers, provided that you
also include the original English version of this License and the original versions of
those notices and disclaimers. In case of a disagreement between the translation andthe original version of this License or a notice or disclaimer, the original version will
prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically requirechanging the actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly
provided for under this License. Any other attempt to copy, modify, sublicense or
distribute the Document is void, and will automatically terminate your rights under
this License. However, parties who have received copies, or rights, from you under thisLicense will not have their licenses terminated so long as such parties remain in fullcompliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of the GNU Free
Documentation License from time to time. Such new versions will be similar in spirit
to the present version, but may differ in detail to address new problems or concerns.
See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document
specifies that a particular numbered version of this License “or any later version”
applies to it, you have the option of following the terms and conditions either of thatspecified version or of any later version that has been published (not as a draft) by
the Free Software Foundation. If the Document does not specify a version number ofAppendix A: Copying This Manual48

this License, you may choose any version ever published (not as a draft) by the Free
Software Foundation.

Appendix A: Copying This Manual49

A.1.1 ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of the License in the
document and put the following copyright and license notices just after the title page:
Copyright (C) year your name.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-CoverTexts. A copy of the license is included in the section entitled ‘‘GNUFree Documentation License’’.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the“with...Texts.” line with this:with the Invariant Sections being list their titles, with
the Front-Cover Texts being list, and with the Back-Cover Texts
being list.

If you have Invariant Sections without Cover Texts, or some other combination of thethree, merge those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasingthese examples in parallel under your choice of free software license, such as the GNU
General Public License, to permit their use in free software.

50

Concept Index
A

M

ANSI color codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

minimum, of a mathematical function . . . . . . . . . . 22

Ccolor codes, ANSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Ffactors, prime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
FDL, GNU Free Documentation License . . . . . . . . 42

G
golden section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Goosh module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

H

N
numbers, prime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
numbers, prime factors of . . . . . . . . . . . . . . . . . . . . . . 23

P
pipeline, process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
ports, for logging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
prime factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
prime number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
process chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
process, Operating System . . . . . . . . . . . . . . . . . . . . . 24

handlers, relationship with loggers . . . . . . . . . . . . . . 12L
log levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
loggers, relationship with handlers . . . . . . . . . . . . . . 12
logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
logs, rotating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
logs, through ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Ssection, golden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Tterminals, ANSI color codes for . . . . . . . . . . . . . . . . 39

51

Function Index
AF

accept-log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
add-handler! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
add-strings! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
all-completions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
apicheck-generate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
apicheck-validate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
assert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 41
assert-equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
assert-exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
assert-false . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
assert-numeric-= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
assert-true . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
async-dequeue! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
async-enqueue! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

factor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
failure-messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
fill-string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
find-string-from-port? . . . . . . . . . . . . . . . . . . . . . . 11
flush-log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
force-ref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Bbinary-search-sorted-vector . . . . . . . . . . . . . . . . 31
breadth-first-search . . . . . . . . . . . . . . . . . . . . . . . . 31

G
golden-section-search . . . . . . . . . . . . . . . . . . . . . . . 22H
html->shtml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
html->sxml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
html->sxml-0nf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
html->sxml-1nf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
html->sxml-2nf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

LC
case-sensitive-completion? . . . . . . . . . . . . . . 32, 33
center-string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
cerr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
close-log! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
collapse-repeated-chars . . . . . . . . . . . . . . . . . . . . . 36
color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
colorize-string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
config-error-arguments . . . . . . . . . . . . . . . . . . . . . . . 2
cout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Ddefine-class-with-docs . . . . . . . . . . . . . . . . . . . . . . 28
define-generic-with-docs . . . . . . . . . . . . . . . . . . . . 28
define-macro-with-docs . . . . . . . . . . . . . . . . . . . . . . 28
define-with-docs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
define/kwargs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
depth-first-search . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
disable-log-level! . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

lambda/kwargs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
left-justify-string. . . . . . . . . . . . . . . . . . . . . . . . . . 36
load-config! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
log-msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
lookup-logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

M
make-async-queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
make-html-tokenizer. . . . . . . . . . . . . . . . . . . . . . . . . . 10
make-node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
match-bind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Nname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
nodal-tree? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
node-children . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
node-ref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
node-set! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

OE
emit-log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
enable-log-level! . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
escape-special-chars . . . . . . . . . . . . . . . . . . . . . . . . 35
exit-with-summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
expand-tabs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

open-log! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
os:process:new-comm-pipes . . . . . . . . . . . . . . . . . . . 25
os:process:pipe-fork-child. . . . . . . . . . . . . . . . . . 24
os:process:pipe-make-commands . . . . . . . . . . . . . . 25
os:process:pipe-make-redir-commands . . . . . . . 25
os:process:setup-redirected-port . . . . . . . . . . . 26

Function IndexP
parse-html/tokenizer . . . . . . . . . . . . . . . . . . . . . . . . 10
prime<. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
prime>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
prime?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
primes< . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
primes> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

R
register-logger! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
right-justify-string . . . . . . . . . . . . . . . . . . . . . . . . 36
run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 40, 41
run+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
run-all-defined-test-cases. . . . . . . . . . . . . . . . . . 41
run-concurrently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
run-concurrently+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
run-with-pipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Ss/// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
s///g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
set-default-logger!. . . . . . . . . . . . . . . . . . . . . . . . . . 15
set-up-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
shtml->html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
shtml-entity-value . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
shtml-token-kind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

52soundex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
string->wrapped-lines . . . . . . . . . . . . . . . . . . . . . . . 38
summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
sxml->html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

T
tail-call-pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
tail-call-pipeline+. . . . . . . . . . . . . . . . . . . . . . . . . . 25
tail-call-program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
tear-down-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
test-failed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
test-htmlprag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
test-started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
tests-failed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
tests-log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
tests-run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
tokenize-html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
topological-sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
topological-sortq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
topological-sortv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8transform-string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Wwrite-shtml-as-html. . . . . . . . . . . . . . . . . . . . . . . . . . 10
write-sxml-html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10