aboutsummaryrefslogtreecommitdiffstats
path: root/slib.info
diff options
context:
space:
mode:
Diffstat (limited to 'slib.info')
-rw-r--r--slib.info3915
1 files changed, 2594 insertions, 1321 deletions
diff --git a/slib.info b/slib.info
index 8e62273..420aa7c 100644
--- a/slib.info
+++ b/slib.info
@@ -1,5 +1,4 @@
-This is Info file slib.info, produced by Makeinfo version 1.68 from the
-input file slib.texi.
+This is slib.info, produced by makeinfo version 4.0 from slib.texi.
INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
@@ -9,7 +8,8 @@ END-INFO-DIR-ENTRY
This file documents SLIB, the portable Scheme library.
Copyright (C) 1993 Todd R. Eigenschink
-Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999 Aubrey Jaffer |
+Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Aubrey
+Jaffer
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -28,12 +28,12 @@ translation approved by the author.

File: slib.info, Node: Top, Next: The Library System, Prev: (dir), Up: (dir)
-"SLIB" is a portable library for the programming language "Scheme". It |
-provides a platform independent framework for using "packages" of |
+"SLIB" is a portable library for the programming language "Scheme". It
+provides a platform independent framework for using "packages" of
Scheme procedures and syntax. As distributed, SLIB contains useful
-packages for all Scheme implementations. Its catalog can be |
-transparently extended to accomodate packages specific to a site, |
-implementation, user, or directory. |
+packages for all Scheme implementations. Its catalog can be
+transparently extended to accomodate packages specific to a site,
+implementation, user, or directory.
* Menu:
@@ -86,10 +86,10 @@ sort of numbers are available from an implementation.
Other features correspond to the presence of sets of Scheme procedures
or syntax (macros).
- - Function: provided? FEATURE
+ - Function: provided? feature
Returns `#t' if FEATURE is supported by the current Scheme session.
- - Procedure: provide FEATURE
+ - Procedure: provide feature
Informs SLIB that FEATURE is supported. Henceforth `(provided?
FEATURE)' will return `#t'.
@@ -113,7 +113,7 @@ so that these feature names map to the corresponding files.
SLIB provides a form, `require', which loads the files providing the
requested feature.
- - Procedure: require FEATURE
+ - Procedure: require feature
* If `(provided? FEATURE)' is true, then `require' just returns
an unspecified value.
@@ -128,7 +128,7 @@ requested feature.
The catalog can also be queried using `require:feature->path'.
- - Function: require:feature->path FEATURE
+ - Function: require:feature->path feature
* If FEATURE is already provided, then returns `#t'.
* Otherwise, if FEATURE is in the catalog, the path or list of
@@ -248,8 +248,8 @@ be reloaded the next time the catalog is queried.
will be loaded afresh.
Each file in the table below is descibed in terms of its file-system
-independent "vicinity" (*note Vicinity::.). The entries of a catalog
-in the table override those of catalogs above it in the table.
+independent "vicinity" (*note Vicinity::). The entries of a catalog in
+the table override those of catalogs above it in the table.
`implementation-vicinity' `slibcat'
This file contains the associations for the packages comprising
@@ -310,7 +310,7 @@ Require
Is a list of symbols denoting features supported in this
implementation. *FEATURES* can grow as modules are `require'd.
*FEATURES* must be defined by all implementations (*note
- Porting::.).
+ Porting::).
Here are features which SLIB (`require.scm') adds to *FEATURES*
when appropriate.
@@ -341,28 +341,28 @@ Require
In the following functions if the argument FEATURE is not a symbol it
is assumed to be a pathname.
- - Function: provided? FEATURE
+ - Function: provided? feature
Returns `#t' if FEATURE is a member of `*features*' or `*modules*'
or if FEATURE is supported by a file already loaded and `#f'
otherwise.
- - Procedure: require FEATURE
+ - Procedure: require feature
FEATURE is a symbol. If `(provided? FEATURE)' is true `require'
returns. Otherwise, if `(assq FEATURE *catalog*)' is not `#f',
the associated files will be loaded and `(provided? FEATURE)' will
henceforth return `#t'. An unspecified value is returned. If
FEATURE is not found in `*catalog*', then an error is signaled.
- - Procedure: require PATHNAME
+ - Procedure: require pathname
PATHNAME is a string. If PATHNAME has not already been given as
an argument to `require', PATHNAME is loaded. An unspecified
value is returned.
- - Procedure: provide FEATURE
+ - Procedure: provide feature
Assures that FEATURE is contained in `*features*' if FEATURE is a
symbol and `*modules*' otherwise.
- - Function: require:feature->path FEATURE
+ - Function: require:feature->path feature
Returns `#t' if FEATURE is a member of `*features*' or `*modules*'
or if FEATURE is supported by a file already loaded. Returns a
path if one was found in `*catalog*' under the feature name, and
@@ -386,7 +386,7 @@ these procedures are file system dependent.
These procedures are provided by all implementations.
- - Function: make-vicinity PATH
+ - Function: make-vicinity path
Returns the vicinity of PATH for use by `in-vicinity'.
- Function: program-vicinity
@@ -417,7 +417,7 @@ These procedures are provided by all implementations.
a daemon) or if this concept is meaningless for the platform, then
`home-vicinity' returns `#f'.
- - Function: in-vicinity VICINITY FILENAME
+ - Function: in-vicinity vicinity filename
Returns a filename suitable for use by `slib:load',
`slib:load-source', `slib:load-compiled', `open-input-file',
`open-output-file', etc. The returned filename is FILENAME in
@@ -428,7 +428,7 @@ These procedures are provided by all implementations.
to the value of `(user-vicinity)' is unspecified. For most systems
`in-vicinity' can be `string-append'.
- - Function: sub-vicinity VICINITY NAME
+ - Function: sub-vicinity vicinity name
Returns the vicinity of VICINITY restricted to NAME. This is used
for large systems where names of files in subsystems could
conflict. On systems with directory structure `sub-vicinity' will
@@ -474,22 +474,22 @@ implementations.
implementation and the name of the operating system. An
unspecified value is returned.
- (slib:report-version) => slib "2c7" on scm "5b1" on unix |
+ (slib:report-version) => slib "2d2" on scm "5b1" on unix |
- Function: slib:report
Displays the information of `(slib:report-version)' followed by
almost all the information neccessary for submitting a problem
report. An unspecified value is returned.
- - Function: slib:report #T
+ - Function: slib:report #t
provides a more verbose listing.
- - Function: slib:report FILENAME
+ - Function: slib:report filename
Writes the report to file `filename'.
(slib:report)
=>
- slib "2c7" on scm "5b1" on unix |
+ slib "2d2" on scm "5b1" on unix |
(implementation-vicinity) is "/home/jaffer/scm/"
(library-vicinity) is "/home/jaffer/slib/"
(scheme-file-suffix) is ".scm"
@@ -520,12 +520,12 @@ Input/Output
These procedures are provided by all implementations.
- - Procedure: file-exists? FILENAME
+ - Procedure: file-exists? filename
Returns `#t' if the specified file exists. Otherwise, returns
`#f'. If the underlying implementation does not support this
feature then `#f' is always returned.
- - Procedure: delete-file FILENAME
+ - Procedure: delete-file filename
Deletes the file specified by FILENAME. If FILENAME can not be
deleted, `#f' is returned. Otherwise, `#t' is returned.
@@ -539,20 +539,20 @@ These procedures are provided by all implementations.
directed.
- Procedure: force-output
- - Procedure: force-output PORT
+ - Procedure: force-output port
Forces any pending output on PORT to be delivered to the output
device and returns an unspecified value. The PORT argument may be
omitted, in which case it defaults to the value returned by
`(current-output-port)'.
- Procedure: output-port-width
- - Procedure: output-port-width PORT
+ - Procedure: output-port-width port
Returns the width of PORT, which defaults to
`(current-output-port)' if absent. If the width cannot be
determined 79 is returned.
- Procedure: output-port-height
- - Procedure: output-port-height PORT
+ - Procedure: output-port-height port
Returns the height of PORT, which defaults to
`(current-output-port)' if absent. If the height cannot be
determined 24 is returned.
@@ -565,7 +565,7 @@ Legacy
These procedures are provided by all implementations.
- - Function: identity X
+ - Function: identity x
IDENTITY returns its argument.
Example:
@@ -586,7 +586,7 @@ implementations.
- Constant: nil
Defined as `#f'.
- - Function: last-pair L
+ - Function: last-pair l
Returns the last pair in the list L. Example:
(last-pair (cons 1 2))
=> (1 . 2)
@@ -602,18 +602,18 @@ System
These procedures are provided by all implementations.
- - Procedure: slib:load-source NAME
+ - Procedure: slib:load-source name
Loads a file of Scheme source code from NAME with the default
filename extension used in SLIB. For instance if the filename
extension used in SLIB is `.scm' then `(slib:load-source "foo")'
will load from file `foo.scm'.
- - Procedure: slib:load-compiled NAME
+ - Procedure: slib:load-compiled name
On implementations which support separtely loadable compiled
modules, loads a file of compiled code from NAME with the
implementation's filename extension for compiled code appended.
- - Procedure: slib:load NAME
+ - Procedure: slib:load name
Loads a file of Scheme source or compiled code from NAME with the
appropriate suffixes appended. If both source and compiled code
are present with the appropriate names then the implementation
@@ -623,28 +623,28 @@ These procedures are provided by all implementations.
If an implementation does not support compiled code then
`slib:load' will be identical to `slib:load-source'.
- - Procedure: slib:eval OBJ
+ - Procedure: slib:eval obj
`eval' returns the value of OBJ evaluated in the current top level
environment. *Note Eval:: provides a more general evaluation
facility.
- - Procedure: slib:eval-load FILENAME EVAL
+ - Procedure: slib:eval-load filename eval
FILENAME should be a string. If filename names an existing file,
the Scheme source code expressions and definitions are read from
the file and EVAL called with them sequentially. The
`slib:eval-load' procedure does not affect the values returned by
`current-input-port' and `current-output-port'.
- - Procedure: slib:warn ARG1 ARG2 ...
+ - Procedure: slib:warn arg1 arg2 ...
Outputs a warning message containing the arguments.
- - Procedure: slib:error ARG1 ARG2 ...
+ - Procedure: slib:error arg1 arg2 ...
Outputs an error message containing the arguments, aborts
evaluation of the current form and responds in a system dependent
way to the error. Typical responses are to abort the program or
to enter a read-eval-print loop.
- - Procedure: slib:exit N
+ - Procedure: slib:exit n
- Procedure: slib:exit
Exits from the Scheme session returning status N to the system.
If N is omitted or `#t', a success status is returned to the
@@ -686,7 +686,7 @@ Scheme Syntax Extension Packages
* Syntactic Closures:: 'syntactic-closures
* Syntax-Case Macros:: 'syntax-case
-Syntax extensions (macros) included with SLIB. Also *Note Structures::.
+Syntax extensions (macros) included with SLIB. |
* Fluid-Let:: 'fluid-let
* Yasos:: 'yasos, 'oop, 'collect
@@ -705,11 +705,11 @@ Defmacro
(gentemp) => scm:G0
(gentemp) => scm:G1
- - Function: defmacro:eval E
+ - Function: defmacro:eval e
Returns the `slib:eval' of expanding all defmacros in scheme
expression E.
- - Function: defmacro:load FILENAME
+ - Function: defmacro:load filename
FILENAME should be a string. If filename names an existing file,
the `defmacro:load' procedure reads Scheme source code expressions
and definitions from the file and evaluates them sequentially.
@@ -717,20 +717,20 @@ Defmacro
definitions. The `macro:load' procedure does not affect the values
returned by `current-input-port' and `current-output-port'.
- - Function: defmacro? SYM
+ - Function: defmacro? sym
Returns `#t' if SYM has been defined by `defmacro', `#f' otherwise.
- - Function: macroexpand-1 FORM
- - Function: macroexpand FORM
+ - Function: macroexpand-1 form
+ - Function: macroexpand form
If FORM is a macro call, `macroexpand-1' will expand the macro
call once and return it. A FORM is considered to be a macro call
- only if it is a cons whose `car' is a symbol for which a `defmacr'
- has been defined.
+ only if it is a cons whose `car' is a symbol for which a
+ `defmacro' has been defined.
`macroexpand' is similar to `macroexpand-1', but repeatedly
expands FORM until it is no longer a macro call.
- - Macro: defmacro NAME LAMBDA-LIST FORM ...
+ - Macro: defmacro name lambda-list form ...
When encountered by `defmacro:eval', `defmacro:macroexpand*', or
`defmacro:load' defines a new macro which will henceforth be
expanded when encountered by `defmacro:eval',
@@ -741,7 +741,7 @@ Defmacroexpand
`(require 'defmacroexpand)'
- - Function: defmacro:expand* E
+ - Function: defmacro:expand* e
Returns the result of expanding all defmacros in scheme expression
E.
@@ -759,15 +759,15 @@ Otherwise, one of the R4RS macros implemetations is loaded.
The SLIB R4RS macro implementations support the following uniform
interface:
- - Function: macro:expand SEXPRESSION
+ - Function: macro:expand sexpression
Takes an R4RS expression, macro-expands it, and returns the result
of the macro expansion.
- - Function: macro:eval SEXPRESSION
+ - Function: macro:eval sexpression
Takes an R4RS expression, macro-expands it, evals the result of the
macro expansion, and returns the result of the evaluation.
- - Procedure: macro:load FILENAME
+ - Procedure: macro:load filename
FILENAME should be a string. If filename names an existing file,
the `macro:load' procedure reads Scheme source code expressions and
definitions from the file and evaluates them sequentially. These
@@ -784,7 +784,7 @@ Macro by Example
`(require 'macro-by-example)'
A vanilla implementation of `Macro by Example' (Eugene Kohlbecker,
-R4RS) by Dorai Sitaram, (dorai@cs.rice.edu) using `defmacro'.
+R4RS) by Dorai Sitaram, (dorai @ cs.rice.edu) using `defmacro'.
* generating hygienic global `define-syntax' Macro-by-Example macros
*cheaply*.
@@ -797,6 +797,7 @@ R4RS) by Dorai Sitaram, (dorai@cs.rice.edu) using `defmacro'.
* don't suffer the overhead of redefining the repl if `defmacro'
natively supported (most implementations)
+
Caveat
------
@@ -812,7 +813,7 @@ featureful (but also more expensive) versions of syntax-rules available
in slib *Note Macros That Work::, *Note Syntactic Closures::, and *Note
Syntax-Case Macros::.
- - Macro: define-syntax KEYWORD TRANSFORMER-SPEC
+ - Macro: define-syntax keyword transformer-spec
The KEYWORD is an identifier, and the TRANSFORMER-SPEC should be
an instance of `syntax-rules'.
@@ -829,7 +830,7 @@ Syntax-Case Macros::.
(let* (( name2 val2) ...)
body1 body2 ...)))))
- - Macro: syntax-rules LITERALS SYNTAX-RULE ...
+ - Macro: syntax-rules literals syntax-rule ...
LITERALS is a list of identifiers, and each SYNTAX-RULE should be
of the form
@@ -861,19 +862,19 @@ Macros That Work
in that it does not expand derived expression types to primitive
expression types.
- - Function: macro:expand EXPRESSION
- - Function: macwork:expand EXPRESSION
+ - Function: macro:expand expression
+ - Function: macwork:expand expression
Takes an R4RS expression, macro-expands it, and returns the result
of the macro expansion.
- - Function: macro:eval EXPRESSION
- - Function: macwork:eval EXPRESSION
+ - Function: macro:eval expression
+ - Function: macwork:eval expression
`macro:eval' returns the value of EXPRESSION in the current top
level environment. EXPRESSION can contain macro definitions.
Side effects of EXPRESSION will affect the top level environment.
- - Procedure: macro:load FILENAME
- - Procedure: macwork:load FILENAME
+ - Procedure: macro:load filename
+ - Procedure: macwork:load filename
FILENAME should be a string. If filename names an existing file,
the `macro:load' procedure reads Scheme source code expressions and
definitions from the file and evaluates them sequentially. These
@@ -1039,19 +1040,19 @@ Syntactic Closures
`(require 'syntactic-closures)'
- - Function: macro:expand EXPRESSION
- - Function: synclo:expand EXPRESSION
+ - Function: macro:expand expression
+ - Function: synclo:expand expression
Returns scheme code with the macros and derived expression types of
EXPRESSION expanded to primitive expression types.
- - Function: macro:eval EXPRESSION
- - Function: synclo:eval EXPRESSION
+ - Function: macro:eval expression
+ - Function: synclo:eval expression
`macro:eval' returns the value of EXPRESSION in the current top
level environment. EXPRESSION can contain macro definitions.
Side effects of EXPRESSION will affect the top level environment.
- - Procedure: macro:load FILENAME
- - Procedure: synclo:load FILENAME
+ - Procedure: macro:load filename
+ - Procedure: synclo:load filename
FILENAME should be a string. If filename names an existing file,
the `macro:load' procedure reads Scheme source code expressions and
definitions from the file and evaluates them sequentially. These
@@ -1136,13 +1137,14 @@ closures facility.
cond special form. A syntactic closure appearing in a quoted
structure is replaced by its form.
+
Transformer Definition
......................
This section describes the `transformer' special form and the
procedures `make-syntactic-closure' and `capture-syntactic-environment'.
- - Syntax: transformer EXPRESSION
+ - Syntax: transformer expression
Syntax: It is an error if this syntax occurs except as a
TRANSFORMER SPEC.
@@ -1204,7 +1206,7 @@ procedures `make-syntactic-closure' and `capture-syntactic-environment'.
`make-syntactic-closure' to close the form in a syntactic
environment.
- - Function: make-syntactic-closure ENVIRONMENT FREE-NAMES FORM
+ - Function: make-syntactic-closure environment free-names form
ENVIRONMENT must be a syntactic environment, FREE-NAMES must be a
list of identifiers, and FORM must be a form.
`make-syntactic-closure' constructs and returns a syntactic closure
@@ -1238,7 +1240,7 @@ procedures `make-syntactic-closure' and `capture-syntactic-environment'.
To obtain a syntactic environment other than the usage
environment, use `capture-syntactic-environment'.
- - Function: capture-syntactic-environment PROCEDURE
+ - Function: capture-syntactic-environment procedure
`capture-syntactic-environment' returns a form that will, when
transformed, call PROCEDURE on the current syntactic environment.
PROCEDURE should compute and return a new form to be transformed,
@@ -1357,7 +1359,7 @@ the usage environment. This guarantees that the macro transformation
is hygienic, without requiring the transformer to know the syntactic
roles of the substituted input subforms.
- - Function: identifier? OBJECT
+ - Function: identifier? object
Returns `#t' if OBJECT is an identifier, otherwise returns `#f'.
Examples:
(identifier? 'a)
@@ -1390,8 +1392,8 @@ roles of the substituted input subforms.
environment as the symbol `else' means in the transformer
environment.
- - Function: identifier=? ENVIRONMENT1 IDENTIFIER1 ENVIRONMENT2
- IDENTIFIER2
+ - Function: identifier=? environment1 identifier1 environment2
+ identifier2
ENVIRONMENT1 and ENVIRONMENT2 must be syntactic environments, and
IDENTIFIER1 and IDENTIFIER2 must be identifiers. `identifier=?'
returns `#t' if the meaning of IDENTIFIER1 in ENVIRONMENT1 is the
@@ -1440,19 +1442,19 @@ Syntax-Case Macros
`(require 'syntax-case)'
- - Function: macro:expand EXPRESSION
- - Function: syncase:expand EXPRESSION
+ - Function: macro:expand expression
+ - Function: syncase:expand expression
Returns scheme code with the macros and derived expression types of
EXPRESSION expanded to primitive expression types.
- - Function: macro:eval EXPRESSION
- - Function: syncase:eval EXPRESSION
+ - Function: macro:eval expression
+ - Function: syncase:eval expression
`macro:eval' returns the value of EXPRESSION in the current top
level environment. EXPRESSION can contain macro definitions.
Side effects of EXPRESSION will affect the top level environment.
- - Procedure: macro:load FILENAME
- - Procedure: syncase:load FILENAME
+ - Procedure: macro:load filename
+ - Procedure: syncase:load filename
FILENAME should be a string. If filename names an existing file,
the `macro:load' procedure reads Scheme source code expressions and
definitions from the file and evaluates them sequentially. These
@@ -1463,9 +1465,9 @@ Syntax-Case Macros
This is version 2.1 of `syntax-case', the low-level macro facility
proposed and implemented by Robert Hieb and R. Kent Dybvig.
- This version is further adapted by Harald Hanche-Olsen
-<hanche@imf.unit.no> to make it compatible with, and easily usable
-with, SLIB. Mainly, these adaptations consisted of:
+ This version is further adapted by Harald Hanche-Olsen <hanche @ |
+imf.unit.no> to make it compatible with, and easily usable with, SLIB. |
+Mainly, these adaptations consisted of: |
* Removing white space from `expand.pp' to save space in the
distribution. This file is not meant for human readers anyway...
@@ -1494,7 +1496,7 @@ distribution by anonymous FTP in
(require 'syntax-case)
(require 'repl)
(repl:top-level macro:eval)
- See the section Repl (*note Repl::.) for more information.
+ See the section Repl (*note Repl::) for more information.
To check operation of syntax-case get
`cs.indiana.edu:/pub/scheme/syntax-case', and type
@@ -1533,7 +1535,7 @@ incompatibilities should be confined to `hooks.ss'. Please let us know
if there is some incompatibility that is not flagged as such.
Send bug reports, comments, suggestions, and questions to Kent Dybvig
-(dyb@iuvax.cs.indiana.edu).
+(dyb @ iuvax.cs.indiana.edu).
Note from maintainer
--------------------
@@ -1563,7 +1565,7 @@ their original values, and the value of the last EXPRESSION is returned.
The syntax of this special form is similar to that of `let', but
`fluid-let' temporarily rebinds existing VARIABLEs. Unlike `let',
-`fluid-let' creates no new bindings; instead it *assigns* the values of
+`fluid-let' creates no new bindings; instead it _assigns_ the values of
each INIT to the binding (determined by the rules of lexical scoping)
of its corresponding VARIABLE.
@@ -1607,7 +1609,7 @@ Terms
"Operation"
A METHOD.
-*Notes:*
+_Notes:_
The object system supports multiple inheritance. An instance can
inherit from 0 or more ancestors. In the case of multiple
inherited operations with the same identity, the operation used is
@@ -1618,7 +1620,7 @@ Terms
dispatch is by a procedure call a la CLOS rather than by `send'
syntax a la Smalltalk.
-*Disclaimer:*
+_Disclaimer:_
There are a number of optimizations which can be made. This
implementation is expository (although performance should be quite
reasonable). See the L&FP paper for some suggestions.
@@ -1629,12 +1631,12 @@ File: slib.info, Node: Yasos interface, Next: Setters, Prev: Yasos terms, Up
Interface
---------
- - Syntax: define-operation `('OPNAME SELF ARG ...`)' DEFAULT-BODY
+ - Syntax: define-operation `('opname self arg ...`)' DEFAULT-BODY
Defines a default behavior for data objects which don't handle the
operation OPNAME. The default behavior (for an empty
DEFAULT-BODY) is to generate an error.
- - Syntax: define-predicate OPNAME?
+ - Syntax: define-predicate opname?
Defines a predicate OPNAME?, usually used for determining the
"type" of an object, such that `(OPNAME? OBJECT)' returns `#t' if
OBJECT has an operation OPNAME? and `#f' otherwise.
@@ -1644,8 +1646,8 @@ Interface
operations. Invoking `(NAME OBJECT ARG ...' executes the BODY of
the OBJECT with SELF bound to OBJECT and with argument(s) ARG....
- - Syntax: object-with-ancestors `(('ANCESTOR1 INIT1`)' ...`)'
- OPERATION ...
+ - Syntax: object-with-ancestors `(('ancestor1 init1`)' ...`)'
+ operation ...
A `let'-like form of `object' for multiple inheritance. It
returns an object inheriting the behaviour of ANCESTOR1 etc. An
operation will be invoked in an ancestor if the object itself does
@@ -1653,21 +1655,21 @@ Interface
operations with the same identity, the operation used is the one
found in the first ancestor in the ancestor list.
- - Syntax: operate-as COMPONENT OPERATION SELF ARG ...
+ - Syntax: operate-as component operation self arg ...
Used in an operation definition (of SELF) to invoke the OPERATION
in an ancestor COMPONENT but maintain the object's identity. Also
known as "send-to-super".
- - Procedure: print OBJ PORT
+ - Procedure: print obj port
A default `print' operation is provided which is just `(format
- PORT OBJ)' (*note Format::.) for non-instances and prints OBJ
+ PORT OBJ)' (*note Format::) for non-instances and prints OBJ
preceded by `#<INSTANCE>' for instances.
- - Function: size OBJ
+ - Function: size obj
The default method returns the number of elements in OBJ if it is
a vector, string or list, `2' for a pair, `1' for a character and
by default id an error otherwise. Objects such as collections
- (*note Collections::.) may override the default in an obvious way.
+ (*note Collections::) may override the default in an obvious way.

File: slib.info, Node: Setters, Next: Yasos examples, Prev: Yasos interface, Up: Yasos
@@ -1681,7 +1683,7 @@ value from a generalized location and the corresponding setter
operation stores a value into the location. Only the getter is named -
the setter is specified by a procedure call as below. (Dylan uses
special syntax.) Typically, but not necessarily, getters are access
-operations to extract values from Yasos objects (*note Yasos::.).
+operations to extract values from Yasos objects (*note Yasos::).
Several setters are predefined, corresponding to getters `car', `cdr',
`string-ref' and `vector-ref' e.g., `(setter car)' is equivalent to
`set-car!'.
@@ -1691,7 +1693,7 @@ Several setters are predefined, corresponding to getters `car', `cdr',
Research and Technology). Common LISP provides similar facilities
through `setf'.
- - Function: setter GETTER
+ - Function: setter getter
Returns the setter for the procedure GETTER. E.g., since
`string-ref' is the getter corresponding to a setter which is
actually `string-set!':
@@ -1699,7 +1701,7 @@ through `setf'.
((setter string-ref) foo 0 #\F) ; set element 0 of foo
foo => "Foo"
- - Syntax: set PLACE NEW-VALUE
+ - Syntax: set place new-value
If PLACE is a variable name, `set' is equivalent to `set!'.
Otherwise, PLACE must have the form of a procedure call, where the
procedure name refers to a getter and the call indicates an
@@ -1712,17 +1714,17 @@ through `setf'.
(set foo "foo") ; like set!
foo => "foo"
- - Procedure: add-setter GETTER SETTER
+ - Procedure: add-setter getter setter
Add procedures GETTER and SETTER to the (inaccessible) list of
valid setter/getter pairs. SETTER implements the store operation
corresponding to the GETTER access operation for the relevant
state. The return value is unspecified.
- - Procedure: remove-setter-for GETTER
+ - Procedure: remove-setter-for getter
Removes the setter corresponding to the specified GETTER from the
list of valid setters. The return value is unspecified.
- - Syntax: define-access-operation GETTER-NAME
+ - Syntax: define-access-operation getter-name
Shorthand for a Yasos `define-operation' defining an operation
GETTER-NAME that objects may support to return the value of some
mutable state. The default operation is to signal an error. The
@@ -1840,7 +1842,10 @@ Textual Conversion Packages
* Format:: Common-Lisp Format
* Standard Formatted I/O:: Posix printf and scanf
* Programs and Arguments::
-* HTML HTTP and CGI:: Generate pages and serve WWW sites
+* HTML::
+* HTML Tables:: Databases meet HTML
+* HTTP and CGI:: Serve WWW sites
+* URI:: Uniform Resource Identifier
* Printing Scheme:: Nicely
* Time and Date::
* Vector Graphics::
@@ -1968,7 +1973,7 @@ or
(set! *syn-defs* *syn-ignore-whitespace*)
- - Function: prec:define-grammar RULE1 ...
+ - Function: prec:define-grammar rule1 ...
Appends RULE1 ... to *SYN-DEFS*. `prec:define-grammar' is used to
define both the character classes and rules for tokens.
@@ -1977,8 +1982,8 @@ variable (for use when calling `prec:parse').
(define my-ruleset *syn-defs*)
- - Function: prec:parse RULESET DELIM
- - Function: prec:parse RULESET DELIM PORT
+ - Function: prec:parse ruleset delim
+ - Function: prec:parse ruleset delim port
The RULESET argument must be a list of rules as constructed by
`prec:define-grammar' and extracted from *SYN-DEFS*.
@@ -2010,7 +2015,7 @@ File: slib.info, Node: Token definition, Next: Nud and Led Definition, Prev:
Token definition
----------------
- - Function: tok:char-group GROUP CHARS CHARS-PROC
+ - Function: tok:char-group group chars chars-proc
The argument CHARS may be a single character, a list of
characters, or a string. Each character in CHARS is treated as
though `tok:char-group' was called with that character alone.
@@ -2085,7 +2090,7 @@ In his paper,
the "left binding power" (or "lbp") was an independent property of
tokens. I think this was done in order to allow tokens with NUDs but
not LEDs to also be used as delimiters, which was a problem for
-statically defined syntaxes. It turns out that *dynamically binding*
+statically defined syntaxes. It turns out that _dynamically binding_
NUDs and LEDs allows them independence.
For the rule-defining procedures that follow, the variable TK may be a
@@ -2097,7 +2102,7 @@ Character TK arguments will match only character tokens; i.e.
characters for which no token-group is assigned. Symbols and strings
will both match token strings; i.e. tokens resulting from token groups.
- - Function: prec:make-nud TK SOP ARG1 ...
+ - Function: prec:make-nud tk sop arg1 ...
Returns a rule specifying that SOP be called when TK is parsed.
If SOP is a procedure, it is called with TK and ARG1 ... as its
arguments; the resulting value is incorporated into the expression
@@ -2107,7 +2112,7 @@ If no NUD has been defined for a token; then if that token is a string,
it is converted to a symbol and returned; if not a string, the token is
returned.
- - Function: prec:make-led TK SOP ARG1 ...
+ - Function: prec:make-led tk sop arg1 ...
Returns a rule specifying that SOP be called when TK is parsed and
LEFT has an unclaimed parsed expression. If SOP is a procedure,
it is called with LEFT, TK, and ARG1 ... as its arguments; the
@@ -2140,19 +2145,19 @@ Character TK arguments will match only character tokens; i.e.
characters for which no token-group is assigned. Symbols and strings
will both match token strings; i.e. tokens resulting from token groups.
- - Function: prec:delim TK
+ - Function: prec:delim tk
Returns a rule specifying that TK should not be returned from
parsing; i.e. TK's function is purely syntactic. The end-of-file
is always treated as a delimiter.
- - Function: prec:nofix TK SOP
+ - Function: prec:nofix tk sop
Returns a rule specifying the following actions take place when TK
is parsed:
* If SOP is a procedure, it is called with no arguments; the
resulting value is incorporated into the expression being
built. Otherwise, the list of SOP is incorporated.
- - Function: prec:prefix TK SOP BP RULE1 ...
+ - Function: prec:prefix tk sop bp rule1 ...
Returns a rule specifying the following actions take place when TK
is parsed:
* The rules RULE1 ... augment and, in case of conflict, override
@@ -2169,7 +2174,7 @@ will both match token strings; i.e. tokens resulting from token groups.
* The ruleset in effect before TK was parsed is restored; RULE1
... are forgotten.
- - Function: prec:infix TK SOP LBP BP RULE1 ...
+ - Function: prec:infix tk sop lbp bp rule1 ...
Returns a rule declaring the left-binding-precedence of the token
TK is LBP and specifying the following actions take place when TK
is parsed:
@@ -2188,7 +2193,7 @@ will both match token strings; i.e. tokens resulting from token groups.
* The ruleset in effect before TK was parsed is restored; RULE1
... are forgotten.
- - Function: prec:nary TK SOP BP
+ - Function: prec:nary tk sop bp
Returns a rule declaring the left-binding-precedence of the token
TK is BP and specifying the following actions take place when TK
is parsed:
@@ -2201,7 +2206,7 @@ will both match token strings; i.e. tokens resulting from token groups.
the LEFT expression, and the parsed expressions is
incorporated.
- - Function: prec:postfix TK SOP LBP
+ - Function: prec:postfix tk sop lbp
Returns a rule declaring the left-binding-precedence of the token
TK is LBP and specifying the following actions take place when TK
is parsed:
@@ -2210,7 +2215,7 @@ will both match token strings; i.e. tokens resulting from token groups.
built. Otherwise, the list of SOP and the LEFT expression is
incorporated.
- - Function: prec:prestfix TK SOP BP RULE1 ...
+ - Function: prec:prestfix tk sop bp rule1 ...
Returns a rule specifying the following actions take place when TK
is parsed:
* The rules RULE1 ... augment and, in case of conflict, override
@@ -2227,14 +2232,14 @@ will both match token strings; i.e. tokens resulting from token groups.
* The ruleset in effect before TK was parsed is restored; RULE1
... are forgotten.
- - Function: prec:commentfix TK STP MATCH RULE1 ...
+ - Function: prec:commentfix tk stp match rule1 ...
Returns rules specifying the following actions take place when TK
is parsed:
* The rules RULE1 ... augment and, in case of conflict, override
rules currently in effect.
* Characters are read until and end-of-file or a sequence of
- characters is read which matches the *string* MATCH.
+ characters is read which matches the _string_ MATCH.
* If STP is a procedure, it is called with the string of all
that was read between the TK and MATCH (exclusive).
@@ -2247,7 +2252,7 @@ will both match token strings; i.e. tokens resulting from token groups.
STP but does not return its value; nay any value. I added the STP
argument so that comment text could be echoed.
- - Function: prec:matchfix TK SOP SEP MATCH RULE1 ...
+ - Function: prec:matchfix tk sop sep match rule1 ...
Returns a rule specifying the following actions take place when TK
is parsed:
* The rules RULE1 ... augment and, in case of conflict, override
@@ -2267,7 +2272,7 @@ will both match token strings; i.e. tokens resulting from token groups.
* The ruleset in effect before TK was parsed is restored; RULE1
... are forgotten.
- - Function: prec:inmatchfix TK SOP SEP MATCH LBP RULE1 ...
+ - Function: prec:inmatchfix tk sop sep match lbp rule1 ...
Returns a rule declaring the left-binding-precedence of the token
TK is LBP and specifying the following actions take place when TK
is parsed:
@@ -2308,7 +2313,7 @@ File: slib.info, Node: Format Interface, Next: Format Specification, Prev: Fo
Format Interface
----------------
- - Function: format DESTINATION FORMAT-STRING . ARGUMENTS
+ - Function: format destination format-string . arguments
An almost complete implementation of Common LISP format description
according to the CL reference book `Common LISP' from Guy L.
Steele, Digital Press. Backward compatible to most of the
@@ -2441,7 +2446,7 @@ directive parameter descriptions.
`~:R'
print a number as an ordinal English number.
-`~:@R'
+`~R'
print a number as a cardinal English number.
`~P'
@@ -2783,11 +2788,11 @@ Standard Formatted Output
`(require 'printf)'
- - Procedure: printf FORMAT ARG1 ...
- - Procedure: fprintf PORT FORMAT ARG1 ...
- - Procedure: sprintf STR FORMAT ARG1 ...
- - Procedure: sprintf #F FORMAT ARG1 ...
- - Procedure: sprintf K FORMAT ARG1 ...
+ - Procedure: printf format arg1 ...
+ - Procedure: fprintf port format arg1 ...
+ - Procedure: sprintf str format arg1 ...
+ - Procedure: sprintf #f format arg1 ...
+ - Procedure: sprintf k format arg1 ...
Each function converts, formats, and outputs its ARG1 ...
arguments according to the control string FORMAT argument and
returns the number of characters output.
@@ -2850,7 +2855,7 @@ Standard Formatted Output
`%d', `%i', or `%u' conversions. Using this flag
produces output which can be parsed by the `scanf'
functions with the `%i' conversion (*note Standard
- Formatted Input::.).
+ Formatted Input::).
`0'
Pad the field with zeros instead of spaces. The zeros
@@ -2861,9 +2866,9 @@ Standard Formatted Output
* An optional decimal integer specifying the "minimum field
width". If the normal conversion produces fewer characters
than this, the field is padded (with spaces or zeros per the
- `0' flag) to the specified width. This is a *minimum* width;
+ `0' flag) to the specified width. This is a _minimum_ width;
if the normal conversion produces more characters than this,
- the field is *not* truncated.
+ the field is _not_ truncated.
Alternatively, if the field width is `*', the next argument
in the argument list (before the actual value to be printed)
@@ -2916,10 +2921,15 @@ Standard Formatted Output
Exact Conversions
.................
+ `b', `B' |
+ Print an integer as an unsigned binary number. |
+ |
+ _Note:_ `%b' and `%B' are SLIB extensions. |
+ |
`d', `i'
Print an integer as a signed decimal number. `%d' and `%i'
are synonymous for output, but are different when used with
- `scanf' for input (*note Standard Formatted Input::.).
+ `scanf' for input (*note Standard Formatted Input::).
`o'
Print an integer as an unsigned octal number.
@@ -2944,13 +2954,18 @@ Inexact Conversions
between mantissa and exponont.
`g', `G'
- Print a floating-point number in either fixed or exponential |
+ Print a floating-point number in either fixed or exponential
notation, whichever is more appropriate for its magnitude.
- Unless an `#' flag has been supplied trailing zeros after a
- decimal point will be stripped off. `%g' prints `e' between
+ Unless an `#' flag has been supplied, trailing zeros after a
+ decimal point will be stripped off. `%g' prints `e' between
mantissa and exponont. `%G' prints `E' between mantissa and
exponent.
+ `k', `K'
+ Print a number like `%g', except that an SI prefix is output
+ after the number, which is scaled accordingly. `%K' outputs
+ a space between number and prefix, `%k' does not.
+
Other Conversions
.................
@@ -2972,12 +2987,12 @@ Other Conversions
precision specifies the maximum number of characters to
output; otherwise as many characters as needed are output.
- *Note:* `%a' and `%A' are SLIB extensions.
+ _Note:_ `%a' and `%A' are SLIB extensions.
`%'
Print a literal `%' character. No argument is consumed. It
- is an error to specifiy flags, field width, precision, or
- type modifiers with `%%'.
+ is an error to specify flags, field width, precision, or type |
+ modifiers with `%%'. |

File: slib.info, Node: Standard Formatted Input, Prev: Standard Formatted Output, Up: Standard Formatted I/O
@@ -2987,13 +3002,13 @@ Standard Formatted Input
`(require 'scanf)'
- - Function: scanf-read-list FORMAT
- - Function: scanf-read-list FORMAT PORT
- - Function: scanf-read-list FORMAT STRING
+ - Function: scanf-read-list format
+ - Function: scanf-read-list format port
+ - Function: scanf-read-list format string
- - Macro: scanf FORMAT ARG1 ...
- - Macro: fscanf PORT FORMAT ARG1 ...
- - Macro: sscanf STR FORMAT ARG1 ...
+ - Macro: scanf format arg1 ...
+ - Macro: fscanf port format arg1 ...
+ - Macro: sscanf str format arg1 ...
Each function reads characters, interpreting them according to the
control string FORMAT argument.
@@ -3041,6 +3056,7 @@ Standard Formatted Input
numerical maximum-field width, an optional `l', `h' or `L'
which is ignored, and a conversion code.
+
Unless the specification contains the `n' conversion character
(described below), a conversion specification directs the
conversion of the next input field. The result of a conversion
@@ -3051,7 +3067,7 @@ Standard Formatted Input
characters; it extends to the next inappropriate character or
until the field width, if specified, is exhausted.
- *Note:* This specification of format strings differs from the
+ _Note:_ This specification of format strings differs from the
`ANSI C' and `POSIX' specifications. In SLIB, white space
before an input field is not skipped unless white space
appears before the conversion specification in the format
@@ -3138,7 +3154,7 @@ Standard Formatted Input
offending character is left unread in the input stream.

-File: slib.info, Node: Programs and Arguments, Next: HTML HTTP and CGI, Prev: Standard Formatted I/O, Up: Textual Conversion Packages
+File: slib.info, Node: Programs and Arguments, Next: HTML, Prev: Standard Formatted I/O, Up: Textual Conversion Packages
Program and Arguments
=====================
@@ -3162,7 +3178,7 @@ Getopt
This routine implements Posix command line argument parsing. Notice
that returning values through global variables means that `getopt' is
-*not* reentrant.
+_not_ reentrant.
- Variable: *optind*
Is the index of the current element of the command line. It is
@@ -3173,7 +3189,7 @@ that returning values through global variables means that `getopt' is
Is set by getopt to the (string) option-argument of the current
option.
- - Procedure: getopt ARGC ARGV OPTSTRING
+ - Procedure: getopt argc argv optstring
Returns the next option letter in ARGV (starting from `(vector-ref
argv *optind*)') that matches a letter in OPTSTRING. ARGV is a
vector or list of strings, the 0th of which getopt usually
@@ -3260,7 +3276,7 @@ that returning values through global variables means that `getopt' is
Getopt-
-------
- - Function: getopt- ARGC ARGV OPTSTRING
+ - Function: getopt- argc argv optstring
The procedure `getopt--' is an extended version of `getopt' which
parses "long option names" of the form `--hold-the-onions' and
`--verbosity-level=extreme'. `Getopt--' behaves as `getopt'
@@ -3302,7 +3318,7 @@ Command Line
`(require 'read-command)'
- - Function: read-command PORT
+ - Function: read-command port
- Function: read-command
`read-command' converts a "command line" into a list of strings
suitable for parsing by `getopt'. The syntax of command lines
@@ -3359,7 +3375,7 @@ Command Line
treated as whitespace by `read-dommand-line' and backslashes
before <newline>s in comments are also ignored.
- - Function: read-options-file FILENAME
+ - Function: read-options-file filename
`read-options-file' converts an "options file" into a list of
strings suitable for parsing by `getopt'. The syntax of options
files is the same as the syntax for command lines, except that
@@ -3391,18 +3407,25 @@ allows for more than one value per parameter-name.
A PARAMETER-LIST is a list of PARAMETERs, each with a different
PARAMETER-NAME.
- - Function: make-parameter-list PARAMETER-NAMES
+ - Function: make-parameter-list parameter-names
Returns an empty parameter-list with slots for PARAMETER-NAMES.
- - Function: parameter-list-ref PARAMETER-LIST PARAMETER-NAME
+ - Function: parameter-list-ref parameter-list parameter-name
PARAMETER-NAME must name a valid slot of PARAMETER-LIST.
`parameter-list-ref' returns the value of parameter PARAMETER-NAME
of PARAMETER-LIST.
- - Procedure: adjoin-parameters! PARAMETER-LIST PARAMETER1 ...
+ - Function: remove-parameter parameter-name parameter-list
+ Removes the parameter PARAMETER-NAME from PARAMETER-LIST.
+ `remove-parameter' does not alter the argument PARAMETER-LIST.
+
+ If there are more than one PARAMETER-NAME parameters, an error is
+ signaled.
+
+ - Procedure: adjoin-parameters! parameter-list parameter1 ...
Returns PARAMETER-LIST with PARAMETER1 ... merged in.
- - Procedure: parameter-list-expand EXPANDERS PARAMETER-LIST
+ - Procedure: parameter-list-expand expanders parameter-list
EXPANDERS is a list of procedures whose order matches the order of
the PARAMETER-NAMEs in the call to `make-parameter-list' which
created PARAMETER-LIST. For each non-false element of EXPANDERS
@@ -3412,7 +3435,7 @@ PARAMETER-NAME.
This process is repeated until PARAMETER-LIST stops growing. The
value returned from `parameter-list-expand' is unspecified.
- - Function: fill-empty-parameters DEFAULTERS PARAMETER-LIST
+ - Function: fill-empty-parameters defaulters parameter-list
DEFAULTERS is a list of procedures whose order matches the order
of the PARAMETER-NAMEs in the call to `make-parameter-list' which
created PARAMETER-LIST. `fill-empty-parameters' returns a new
@@ -3420,14 +3443,14 @@ PARAMETER-NAME.
returned by calling the corresponding DEFAULTER with
PARAMETER-LIST as its argument.
- - Function: check-parameters CHECKS PARAMETER-LIST
+ - Function: check-parameters checks parameter-list
CHECKS is a list of procedures whose order matches the order of
the PARAMETER-NAMEs in the call to `make-parameter-list' which
created PARAMETER-LIST.
`check-parameters' returns PARAMETER-LIST if each CHECK of the
corresponding PARAMETER-LIST returns non-false. If some CHECK
- returns `#f' an error is signaled.
+ returns `#f' a warning is signaled.
In the following procedures ARITIES is a list of symbols. The elements
of `arities' can be:
@@ -3447,12 +3470,11 @@ of `arities' can be:
`nary1'
One or more of parameters are acceptable.
- - Function: parameter-list->arglist POSITIONS ARITIES TYPES
- PARAMETER-LIST
+ - Function: parameter-list->arglist positions arities parameter-list
Returns PARAMETER-LIST converted to an argument list. Parameters
of ARITY type `single' and `boolean' are converted to the single
value associated with them. The other ARITY types are converted
- to lists of the value(s) of type TYPES.
+ to lists of the value(s).
POSITIONS is a list of positive integers whose order matches the
order of the PARAMETER-NAMEs in the call to `make-parameter-list'
@@ -3467,26 +3489,47 @@ Getopt Parameter lists
`(require 'getopt-parameters)'
- - Function: getopt->parameter-list ARGC ARGV OPTNAMES ARITIES TYPES
- ALIASES
+ - Function: getopt->parameter-list argc argv optnames arities types
+ aliases desc ...
Returns ARGV converted to a parameter-list. OPTNAMES are the
- parameter-names. ALIASES is a list of lists of strings and
- elements of OPTNAMES. Each of these strings which have length of
- 1 will be treated as a single <-> option by `getopt'. Longer
- strings will be treated as long-named options (*note getopt-:
- Getopt.).
-
- - Function: getopt->arglist ARGC ARGV OPTNAMES POSITIONS ARITIES TYPES
- DEFAULTERS CHECKS ALIASES
+ parameter-names. ARITIES and TYPES are lists of symbols
+ corresponding to OPTNAMES.
+
+ ALIASES is a list of lists of strings or integers paired with
+ elements of OPTNAMES. Each one-character string will be treated
+ as a single `-' option by `getopt'. Longer strings will be
+ treated as long-named options (*note getopt-: Getopt.).
+
+ If the ALIASES association list has only strings as its `car's,
+ then all the option-arguments after an option (and before the next
+ option) are adjoined to that option.
+
+ If the ALIASES association list has integers, then each (string)
+ option will take at most one option-argument. Unoptioned
+ arguments are collected in a list. A `-1' alias will take the
+ last argument in this list; `+1' will take the first argument in
+ the list. The aliases -2 then +2; -3 then +3; ... are tried so
+ long as a positive or negative consecutive alias is found and
+ arguments remain in the list. Finally a `0' alias, if found,
+ absorbs any remaining arguments.
+
+ In all cases, if unclaimed arguments remain after processing, a
+ warning is signaled and #f is returned.
+
+ - Function: getopt->arglist argc argv optnames positions arities types
+ defaulters checks aliases desc ...
Like `getopt->parameter-list', but converts ARGV to an
argument-list as specified by OPTNAMES, POSITIONS, ARITIES, TYPES,
- DEFAULTERS, CHECKS, and ALIASES.
+ DEFAULTERS, CHECKS, and ALIASES. If the options supplied violate
+ the ARITIES or CHECKS constraints, then a warning is signaled and
+ #f is returned.
These `getopt' functions can be used with SLIB relational databases.
For an example, *Note make-command-server: Database Utilities.
If errors are encountered while processing options, directions for using
-the options are printed to `current-error-port'.
+the options (and argument strings DESC ...) are printed to
+`current-error-port'.
(begin
(set! *optind* 1)
@@ -3533,8 +3576,8 @@ Filenames
`(require 'filename)' or `(require 'glob)'
- - Function: filename:match?? PATTERN
- - Function: filename:match-ci?? PATTERN
+ - Function: filename:match?? pattern
+ - Function: filename:match-ci?? pattern
Returns a predicate which returns a non-false value if its string
argument matches (the string) PATTERN, false otherwise. Filename
matching is like "glob" expansion described the bash manpage,
@@ -3559,8 +3602,8 @@ Filenames
last character in the set.
- - Function: filename:substitute?? PATTERN TEMPLATE
- - Function: filename:substitute-ci?? PATTERN TEMPLATE
+ - Function: filename:substitute?? pattern template
+ - Function: filename:substitute-ci?? pattern template
Returns a function transforming a single string argument according
to glob patterns PATTERN and TEMPLATE. PATTERN and TEMPLATE must
have the same number of wildcard specifications, which need not be
@@ -3589,7 +3632,7 @@ Filenames
((filename:substitute?? "?*?" (lambda (s1 s2 s3) (string-append s3 s1))) "ABZ")
=> "ZA"
- - Function: replace-suffix STR OLD NEW
+ - Function: replace-suffix str old new
STR can be a string or a list of strings. Returns a new string
(or strings) similar to `str' but with the suffix string OLD
removed and the suffix string NEW appended. If the end of STR
@@ -3608,7 +3651,7 @@ Batch
The batch procedures provide a way to write and execute portable scripts
for a variety of operating systems. Each `batch:' procedure takes as
-its first argument a parameter-list (*note Parameter lists::.). This
+its first argument a parameter-list (*note Parameter lists::). This
parameter-list argument PARMS contains named associations. Batch
currently uses 2 of these:
@@ -3630,10 +3673,10 @@ currently uses 2 of these:
* *unknown*
`batch.scm' uses 2 enhanced relational tables (*note Database
-Utilities::.) to store information linking the names of
+Utilities::) to store information linking the names of
`operating-system's to `batch-dialect'es.
- - Function: batch:initialize! DATABASE
+ - Function: batch:initialize! database
Defines `operating-system' and `batch-dialect' tables and adds the
domain `operating-system' to the enhanced relational database
DATABASE.
@@ -3641,10 +3684,10 @@ Utilities::.) to store information linking the names of
- Variable: batch:platform
Is batch's best guess as to which operating-system it is running
under. `batch:platform' is set to `(software-type)' (*note
- Configuration::.) unless `(software-type)' is `unix', in which
- case finer distinctions are made.
+ Configuration::) unless `(software-type)' is `unix', in which case
+ finer distinctions are made.
- - Function: batch:call-with-output-script PARMS FILE PROC
+ - Function: batch:call-with-output-script parms file proc
PROC should be a procedure of one argument. If FILE is an
output-port, `batch:call-with-output-script' writes an appropriate
header to FILE and then calls PROC with FILE as the only argument.
@@ -3654,65 +3697,65 @@ Utilities::.) to store information linking the names of
argument. Otherwise, `batch:call-with-output-script' acts as if
it was called with the result of `(current-output-port)' as its
third argument.
- |
+
The rest of the `batch:' procedures write (or execute if
`batch-dialect' is `system') commands to the batch port which has been
added to PARMS or `(copy-tree PARMS)' by the code:
(adjoin-parameters! PARMS (list 'batch-port PORT))
- - Function: batch:command PARMS STRING1 STRING2 ... |
- Calls `batch:try-command' (below) with arguments, but signals an |
- error if `batch:try-command' returns `#f'. |
+ - Function: batch:command parms string1 string2 ...
+ Calls `batch:try-command' (below) with arguments, but signals an
+ error if `batch:try-command' returns `#f'.
These functions return a non-false value if the command was successfully
translated into the batch dialect and `#f' if not. In the case of the
`system' dialect, the value is non-false if the operation suceeded.
- - Function: batch:try-command PARMS STRING1 STRING2 ... |
+ - Function: batch:try-command parms string1 string2 ...
Writes a command to the `batch-port' in PARMS which executes the
program named STRING1 with arguments STRING2 ....
- - Function: batch:try-chopped-command PARMS ARG1 ARG2 ... LIST |
- breaks the last argument LIST into chunks small enough so that the |
- command: |
- |
- ARG1 ARG2 ... CHUNK |
- |
- fits withing the platform's maximum command-line length. |
- |
- `batch:try-chopped-command' calls `batch:try-command' with the |
- command and returns non-false only if the commands all fit and |
- `batch:try-command' of each command line returned non-false. |
- |
- - Function: batch:run-script PARMS STRING1 STRING2 ...
+ - Function: batch:try-chopped-command parms arg1 arg2 ... list
+ breaks the last argument LIST into chunks small enough so that the
+ command:
+
+ ARG1 ARG2 ... CHUNK
+
+ fits withing the platform's maximum command-line length.
+
+ `batch:try-chopped-command' calls `batch:try-command' with the
+ command and returns non-false only if the commands all fit and
+ `batch:try-command' of each command line returned non-false.
+
+ - Function: batch:run-script parms string1 string2 ...
Writes a command to the `batch-port' in PARMS which executes the
batch script named STRING1 with arguments STRING2 ....
- *Note:* `batch:run-script' and `batch:try-command' are not the |
- same for some operating systems (VMS). |
+ _Note:_ `batch:run-script' and `batch:try-command' are not the
+ same for some operating systems (VMS).
- - Function: batch:comment PARMS LINE1 ...
+ - Function: batch:comment parms line1 ...
Writes comment lines LINE1 ... to the `batch-port' in PARMS.
- - Function: batch:lines->file PARMS FILE LINE1 ...
+ - Function: batch:lines->file parms file line1 ...
Writes commands to the `batch-port' in PARMS which create a file
named FILE with contents LINE1 ....
- - Function: batch:delete-file PARMS FILE
+ - Function: batch:delete-file parms file
Writes a command to the `batch-port' in PARMS which deletes the
file named FILE.
- - Function: batch:rename-file PARMS OLD-NAME NEW-NAME
+ - Function: batch:rename-file parms old-name new-name
Writes a command to the `batch-port' in PARMS which renames the
file OLD-NAME to NEW-NAME.
In addition, batch provides some small utilities very useful for writing
scripts:
- - Function: truncate-up-to PATH CHAR
- - Function: truncate-up-to PATH STRING
- - Function: truncate-up-to PATH CHARLIST
+ - Function: truncate-up-to path char
+ - Function: truncate-up-to path string
+ - Function: truncate-up-to path charlist
PATH can be a string or a list of strings. Returns PATH sans any
prefixes ending with a character of the second argument. This can
be used to derive a filename moved locally from elsewhere.
@@ -3720,22 +3763,22 @@ scripts:
(truncate-up-to "/usr/local/lib/slib/batch.scm" "/")
=> "batch.scm"
- - Function: string-join JOINER STRING1 ...
+ - Function: string-join joiner string1 ...
Returns a new string consisting of all the strings STRING1 ... in
order appended together with the string JOINER between each
adjacent pair.
- - Function: must-be-first LIST1 LIST2
+ - Function: must-be-first list1 list2
Returns a new list consisting of the elements of LIST2 ordered so
that if some elements of LIST1 are `equal?' to elements of LIST2,
then those elements will appear first and in the order of LIST1.
- - Function: must-be-last LIST1 LIST2
+ - Function: must-be-last list1 list2
Returns a new list consisting of the elements of LIST1 ordered so
that if some elements of LIST2 are `equal?' to elements of LIST1,
then those elements will appear last and in the order of LIST2.
- - Function: os->batch-dialect OSNAME
+ - Function: os->batch-dialect osname
Returns its best guess for the `batch-dialect' to be used for the
operating-system named OSNAME. `os->batch-dialect' uses the
tables added to DATABASE by `batch:initialize!'.
@@ -3771,10 +3814,10 @@ Here is an example of the use of most of batch's procedures:
" printf(\"hello world\\n\");"
" return 0;"
"}" )
- (batch:command my-parameters "cc" "-c" "hello.c") |
- (batch:command my-parameters "cc" "-o" "hello" |
+ (batch:command my-parameters "cc" "-c" "hello.c")
+ (batch:command my-parameters "cc" "-o" "hello"
(replace-suffix "hello.c" ".c" ".o"))
- (batch:command my-parameters "hello") |
+ (batch:command my-parameters "hello")
(batch:delete-file my-parameters "hello")
(batch:delete-file my-parameters "hello.c")
(batch:delete-file my-parameters "hello.o")
@@ -3784,7 +3827,7 @@ Here is an example of the use of most of batch's procedures:
Produces the file `my-batch':
#!/bin/sh
- # "my-batch" script created by SLIB/batch Sun Oct 31 18:24:10 1999 |
+ # "my-batch" script created by SLIB/batch Sun Oct 31 18:24:10 1999
# ================ Write file with C program.
mv -f hello.c hello.c~
rm -f hello.c
@@ -3809,208 +3852,515 @@ When run, `my-batch' prints:
hello world

-File: slib.info, Node: HTML HTTP and CGI, Next: Printing Scheme, Prev: Programs and Arguments, Up: Textual Conversion Packages
+File: slib.info, Node: HTML, Next: HTML Tables, Prev: Programs and Arguments, Up: Textual Conversion Packages
-HTML Forms
-==========
+HTML
+====
`(require 'html-form)'
- - Variable: *html:output-port*
- Procedure names starting with `html:' send their output to the
- port *HTML:OUTPUT-PORT*. *HTML:OUTPUT-PORT* is initially the
- current output port.
-
- - Function: make-atval TXT
+ - Function: html:atval txt
Returns a string with character substitutions appropriate to send
TXT as an "attribute-value".
- - Function: make-plain TXT
+ - Function: html:plain txt
Returns a string with character substitutions appropriate to send
TXT as an "plain-text".
- - Function: html:start-page TITLE BACKLINK TAGS ...
- - Function: html:start-page TITLE BACKLINK
- - Function: html:start-page TITLE
- Outputs headers for an HTML page named TITLE. If string arguments
- BACKLINK ... are supplied they are printed verbatim within the
- <HEAD> section.
+ - Function: html:meta name content
+ Returns a tag of meta-information suitable for passing as the
+ third argument to `html:head'. The tag produced is `<META
+ NAME="NAME" CONTENT="CONTENT">'. The string or symbol NAME can be
+ `author', `copyright', `keywords', `description', `date',
+ `robots', ....
+
+ - Function: html:http-equiv name content
+ Returns a tag of HTTP information suitable for passing as the
+ third argument to `html:head'. The tag produced is `<META
+ HTTP-EQUIV="NAME" CONTENT="CONTENT">'. The string or symbol NAME
+ can be `Expires', `PICS-Label', `Content-Type', `Refresh', ....
+
+ - Function: html:meta-refresh delay uri
+ - Function: html:meta-refresh delay
+ Returns a tag suitable for passing as the third argument to
+ `html:head'. If URI argument is supplied, then DELAY seconds after
+ displaying the page with this tag, Netscape or IE browsers will
+ fetch and display URI. Otherwise, DELAY seconds after displaying
+ the page with this tag, Netscape or IE browsers will fetch and
+ redisplay this page.
+
+ - Function: html:head title backlink tags ...
+ - Function: html:head title backlink
+ - Function: html:head title
+ Returns header string for an HTML page named TITLE. If BACKLINK
+ is a string, it is used verbatim between the `H1' tags; otherwise
+ TITLE is used. If string arguments TAGS ... are supplied, then
+ they are included verbatim within the <HEAD> section.
+
+ - Function: html:body body ...
+ Returns HTML string to end a page.
+
+ - Function: html:pre line1 line ...
+ Returns the strings LINE1, LINES as "PRE"formmated plain text
+ (rendered in fixed-width font). Newlines are inserted between
+ LINE1, LINES. HTML tags (`<tag>') within LINES will be visible
+ verbatim.
+
+ - Function: html:comment line1 line ...
+ Returns the strings LINE1 as HTML comments.
+
+HTML Forms
+==========
+
+ - Function: html:form method action body ...
+ The symbol METHOD is either `get', `head', `post', `put', or
+ `delete'. The strings BODY form the body of the form.
+ `html:form' returns the HTML "form".
+
+ - Function: html:hidden name value
+ Returns HTML string which will cause NAME=VALUE in form.
+
+ - Function: html:checkbox pname default
+ Returns HTML string for check box.
+
+ - Function: html:text pname default size ...
+ Returns HTML string for one-line text box.
+
+ - Function: html:text-area pname default-list
+ Returns HTML string for multi-line text box.
+
+ - Function: html:select pname arity default-list foreign-values
+ Returns HTML string for pull-down menu selector.
+
+ - Function: html:buttons pname arity default-list foreign-values
+ Returns HTML string for any-of selector.
+
+ - Function: form:submit submit-label command
+ - Function: form:submit submit-label
+ The string or symbol SUBMIT-LABEL appears on the button which
+ submits the form. If the optional second argument COMMAND is
+ given, then `*command*=COMMAND' and `*button*=SUBMIT-LABEL' are
+ set in the query. Otherwise, `*command*=SUBMIT-LABEL' is set in
+ the query.
+
+ - Function: form:image submit-label image-src
+ The IMAGE-SRC appears on the button which submits the form.
+
+ - Function: form:reset
+ Returns a string which generates a "reset" button.
+
+ - Function: form:element pname arity default-list foreign-values
+ Returns a string which generates an INPUT element for the field
+ named PNAME. The element appears in the created form with its
+ representation determined by its ARITY and domain. For domains
+ which are foreign-keys:
+
+ `single'
+ select menu
+
+ `optional'
+ select menu
+
+ `nary'
+ check boxes
+
+ `nary1'
+ check boxes
- - Function: html:end-page
- Outputs HTML codes to end a page.
+ If the foreign-key table has a field named `visible-name', then
+ the contents of that field are the names visible to the user for
+ those choices. Otherwise, the foreign-key itself is visible.
- - Function: html:pre LINE1 LINE ...
- Writes (using `html:printf') the strings LINE1, LINES as
- "PRE"formmated plain text (rendered in fixed-width font).
- Newlines are inserted between LINE1, LINES. HTML tags (`<tag>')
- within LINES will be visible verbatim.
+ For other types of domains:
- - Function: html:comment LINE1 LINE ...
- Writes (using `html:printf') the strings LINE1 as HTML comments.
+ `single'
+ text area
+
+ `optional'
+ text area
+
+ `boolean'
+ check box
+
+ `nary'
+ text area
+
+ `nary1'
+ text area
+
+ - Function: form:delimited pname doc aliat arity default-list
+ foreign-values
+ Returns a HTML string for a form element embedded in a line of a
+ delimited list. Apply map `form:delimited' to the list returned by
+ `command->p-specs'.
+
+ - Function: command->p-specs rdb command-table command
+ The symbol COMMAND-TABLE names a command table in the RDB
+ relational database. The symbol COMMAND names a key in
+ COMMAND-TABLE.
+
+ `command->p-specs' returns a list of lists of PNAME, DOC, ALIAT,
+ ARITY, DEFAULT-LIST, and FOREIGN-VALUES. The returned list has
+ one element for each parameter of command COMMAND.
+
+ This example demonstrates how to create a HTML-form for the `build'
+ command.
+
+ (require (in-vicinity (implementation-vicinity) "build.scm"))
+ (call-with-output-file "buildscm.html"
+ (lambda (port)
+ (display
+ (string-append
+ (html:head 'commands)
+ (html:body
+ (sprintf #f "<H2>%s:</H2><BLOCKQUOTE>%s</BLOCKQUOTE>\\n"
+ (html:plain 'build)
+ (html:plain ((comtab 'get 'documentation) 'build)))
+ (html:form
+ 'post
+ (or "http://localhost:8081/buildscm" "/cgi-bin/build.cgi")
+ (apply html:delimited-list
+ (apply map form:delimited
+ (command->p-specs build '*commands* 'build)))
+ (form:submit 'build)
+ (form:reset))))
+ port)))
+
+
+File: slib.info, Node: HTML Tables, Next: HTTP and CGI, Prev: HTML, Up: Textual Conversion Packages
HTML Tables
===========
- - Function: html:start-table CAPTION
+ `(require 'db->html)'
+
+ - Function: html:table options row ...
- - Function: html:end-table
+ - Function: html:caption caption align
+ - Function: html:caption caption
+ ALIGN can be `top' or `bottom'.
- - Function: html:heading COLUMNS
+ - Function: html:heading columns
Outputs a heading row for the currently-started table.
- - Function: html:href-heading COLUMNS URLS
- Outputs a heading row with column-names COLUMNS linked to URLs
- URLS.
+ - Function: html:href-heading columns uris
+ Outputs a heading row with column-names COLUMNS linked to URIs
+ URIS.
- - Function: make-row-converter K FOREIGNS
+ - Function: html:linked-row-converter k foreigns
The positive integer K is the primary-key-limit (number of
primary-keys) of the table. FOREIGNS is a list of the filenames of
foreign-key field pages and #f for non foreign-key fields.
- `make-row-converter' returns a procedure taking a row for its
- single argument. This returned procedure prints the table row to
- *HTML:OUTPUT-PORT*.
+ `html:linked-row-converter' returns a procedure taking a row for
+ its single argument. This returned procedure returns the html
+ string for that table row.
- - Function: table-name->filename TABLE-NAME
+ - Function: table-name->filename table-name
Returns the symbol TABLE-NAME converted to a filename.
- - Function: table->html CAPTION DB TABLE-NAME MATCH-KEY1 ...
- Writes HTML for DB table TABLE-NAME to *HTML:OUTPUT-PORT*.
+ - Function: table->linked-html caption db table-name match-key1 ...
+ Returns HTML string for DB table TABLE-NAME. Every foreign-key
+ value is linked to the page (of the table) defining that key.
The optional MATCH-KEY1 ... arguments restrict actions to a subset
of the table. *Note match-key: Table Operations.
- - Function: table->page DB TABLE-NAME INDEX-FILENAME
- Writes a complete HTML page to *HTML:OUTPUT-PORT*. The string
- INDEX-FILENAME names the page which refers to this one.
+ - Function: table->linked-page db table-name index-filename arg ...
+ Returns a complete HTML page. The string INDEX-FILENAME names the
+ page which refers to this one.
- - Function: catalog->html DB CAPTION
- Writes HTML for the catalog table of DB to *HTML:OUTPUT-PORT*.
+ The optional ARGS ... arguments restrict actions to a subset of
+ the table. *Note match-key: Table Operations.
- - Function: catalog->page DB CAPTION
- Writes a complete HTML page for the catalog of DB to
- *HTML:OUTPUT-PORT*.
+ - Function: catalog->html db caption arg ...
+ Returns HTML string for the catalog table of DB.
-HTML Forms
-==========
+HTML editing tables
+-------------------
- - Function: html:start-form METHOD ACTION
- The symbol METHOD is either `get', `head', `post', `put', or
- `delete'. `html:start-form' prints the header for an HTML "form".
+A client can modify one row of an editable table at a time. For any
+change submitted, these routines check if that row has been modified
+during the time the user has been editing the form. If so, an error
+page results.
- - Function: html:end-form PNAME SUBMIT-LABEL
- `html:end-form' prints the footer for an HTML "form". The string
- SUBMIT-LABEL appears on the button which submits the form.
+The behavior of edited rows is:
- - Function: command->html RDB COMMAND-TABLE COMMAND METHOD ACTION
- The symbol COMMAND-TABLE names a command table in the RDB
- relational database.
+ * If no fields are changed, then no change is made to the table.
- `command->html' writes an HTML-2.0 "form" for command COMMAND to
- the current-output-port. The `SUBMIT' button, which is labeled
- COMMAND, invokes the URI ACTION with method METHOD with a hidden
- attribute `*command*' bound to the command symbol submitted.
+ * If the primary keys equal null-keys (parameter defaults), and no
+ other user has modified that row, then that row is deleted.
- An action may invoke a CGI script
- (`http://www.my-site.edu/cgi-bin/search.cgi') or HTTP daemon
- (`http://www.my-site.edu:8001').
+ * If only primary keys are changed, there are non-key fields, and no
+ row with the new keys is in the table, then the old row is deleted
+ and one with the new keys is inserted.
- This example demonstrates how to create a HTML-form for the `build'
- command.
+ * If only non-key fields are changed, and that row has not been
+ modified by another user, then the row is changed to reflect the
+ fields.
- (require (in-vicinity (implementation-vicinity) "build.scm"))
- (call-with-output-file "buildscm.html"
- (lambda (port)
- (fluid-let ((*html:output-port* port))
- (html:start-page 'commands)
- (command->html
- build '*commands* 'build 'post
- (or "/cgi-bin/build.cgi"
- "http://localhost:8081/buildscm"))
- html:end-page)))
-
-HTTP and CGI service
-====================
+ * If both keys and non-key fields are changed, and no row with the
+ new keys is in the table, then a row is created with the new keys
+ and fields.
- `(require 'html-form)'
+ * If fields are changed, all fields are primary keys, and no row with
+ the new keys is in the table, then a row is created with the new
+ keys.
+
+After any change to the table, a `sync-database' of the database is
+performed.
- - Function: cgi:serve-command RDB COMMAND-TABLE
- Reads a `"POST"' or `"GET"' query from `(current-input-port)' and
- executes the encoded command from COMMAND-TABLE in
- relational-database RDB.
+ - Function: command:modify-table table-name null-keys update delete
+ retrieve
+ - Function: command:modify-table table-name null-keys update delete
+ - Function: command:modify-table table-name null-keys update
+ - Function: command:modify-table table-name null-keys
+ Returns procedure (of DB) which returns procedure to modify row of
+ TABLE-NAME. NULL-KEYS is the list of "null" keys which indicate
+ that the row is to be deleted. Optional arguments UPDATE, DELETE,
+ and RETRIEVE default to the `row:update', `row:delete', and
+ `row:retrieve' of TABLE-NAME in DB.
- This example puts up a plain-text page in response to a CGI query.
+ - Function: command:make-editable-table rdb table-name arg ...
+ Given TABLE-NAME in RDB, creates parameter and `*command*' tables
+ for editing one row of TABLE-NAME at a time.
+ `command:make-editable-table' returns a procedure taking a row
+ argument which returns the HTML string for editing that row.
- (display "Content-Type: text/plain") (newline) (newline)
- (require 'html-form)
- (load (in-vicinity (implementation-vicinity) "build.scm"))
- (cgi:serve-command build '*commands*)
+ Optional ARGS are expressions (lists) added to the call to
+ `command:modify-table'.
- - Function: serve-urlencoded-command RDB COMMAND-TABLE URLENCODED
- Reads attribute-value pairs from URLENCODED, converts them to
- parameters and invokes the RDB command named by the parameter
- `*command*'.
+ The domain name of a column determines the expected arity of the
+ data stored in that column. Domain names ending in:
- - Function: http:serve-query INPUT-PORT OUTPUT-PORT SERVE-PROC
- reads the "query-string" from INPUT-PORT. If this is a valid
- `"POST"' or `"GET"' query, then `http:serve-query' calls
- SERVE-PROC with two arguments, the query-string and the
- header-alist.
+ `*'
+ have arity `nary';
+
+ `+'
+ have arity `nary1'.
+
+ - Function: html:editable-row-converter k names edit-point
+ edit-converter
+ The positive integer K is the primary-key-limit (number of
+ primary-keys) of the table. NAMES is a list of the field-names.
+ EDIT-POINT is the list of primary-keys denoting the row to edit
+ (or #f). EDIT-CONVERTER is the procedure called with K, NAMES,
+ and the row to edit.
+
+ `html:editable-row-converter' returns a procedure taking a row for
+ its single argument. This returned procedure returns the html
+ string for that table row.
+
+ Each HTML table constructed using `html:editable-row-converter'
+ has first K fields (typically the primary key fields) of each row
+ linked to a text encoding of these fields (the result of calling
+ `row->anchor'). The page so referenced typically allows the user
+ to edit fields of that row.
+
+HTML databases
+--------------
+
+ - Function: db->html-files db dir index-filename caption
+ DB must be a relational database. DIR must be #f or a non-empty
+ string naming an existing sub-directory of the current directory.
+
+ `db->html-files' creates an html page for each table in the
+ database DB in the sub-directory named DIR, or the current
+ directory if DIR is #f. The top level page with the catalog of
+ tables (captioned CAPTION) is written to a file named
+ INDEX-FILENAME.
+
+ - Function: db->html-directory db dir index-filename
+ - Function: db->html-directory db dir
+ DB must be a relational database. DIR must be a non-empty string
+ naming an existing sub-directory of the current directory or one
+ to be created. The optional string INDEX-FILENAME names the
+ filename of the top page, which defaults to `index.html'.
+
+ `db->html-directory' creates sub-directory DIR if neccessary, and
+ calls `(db->html-files DB DIR INDEX-FILENAME DIR)'. The `file:'
+ URI of INDEX-FILENAME is returned.
+
+ - Function: db->netscape db dir index-filename
+ - Function: db->netscape db dir
+ `db->netscape' is just like `db->html-directory', but calls
+ `browse-url-netscape' with the uri for the top page after the
+ pages are created.
+
+
+File: slib.info, Node: HTTP and CGI, Next: URI, Prev: HTML Tables, Up: Textual Conversion Packages
+
+HTTP and CGI
+============
+
+ `(require 'http)' or `(require 'cgi)'
+
+ - Function: http:header alist
+ Returns a string containing lines for each element of ALIST; the
+ `car' of which is followed by `: ', then the `cdr'.
+
+ - Function: http:content alist body ...
+ Returns the concatenation of strings BODY with the `(http:header
+ ALIST)' and the `Content-Length' prepended.
+
+ - Variable: *http:byline*
+ String appearing at the bottom of error pages.
+
+ - Function: http:error-page status-code reason-phrase html-string ...
+ STATUS-CODE and REASON-PHRASE should be an integer and string as
+ specified in `RFC 2068'. The returned page (string) will show the
+ STATUS-CODE and REASON-PHRASE and any additional HTML-STRINGS ...;
+ with *HTTP:BYLINE* or SLIB's default at the bottom.
+
+ - Function: http:forwarding-page title delay uri html-string ...
+ The string or symbol TITLE is the page title. DELAY is a
+ non-negative integer. The HTML-STRINGS ... are typically used to
+ explain to the user why this page is being forwarded.
+
+ `http:forwarding-page' returns an HTML string for a page which
+ automatically forwards to URI after DELAY seconds. The returned
+ page (string) contains any HTML-STRINGS ... followed by a manual
+ link to URI, in case the browser does not forward automatically.
+
+ - Function: http:serve-query serve-proc input-port output-port
+ reads the "URI" and "query-string" from INPUT-PORT. If the query
+ is a valid `"POST"' or `"GET"' query, then `http:serve-query' calls
+ SERVE-PROC with three arguments, the REQUEST-LINE, QUERY-STRING,
+ and HEADER-ALIST. Otherwise, `http:serve-query' calls SERVE-PROC
+ with the REQUEST-LINE, #f, and HEADER-ALIST.
+
+ If SERVE-PROC returns a string, it is sent to OUTPUT-PORT. If
+ SERVE-PROC returns a list, then an error page with number 525 and
+ strings from the list. If SERVE-PROC returns #f, then a `Bad
+ Request' (400) page is sent to OUTPUT-PORT.
Otherwise, `http:serve-query' replies (to OUTPUT-PORT) with
appropriate HTML describing the problem.
- This example services HTTP queries from port 8081:
+ This example services HTTP queries from PORT-NUMBER:
(define socket (make-stream-socket AF_INET 0))
- (socket:bind socket 8081)
- (socket:listen socket 10)
- (dynamic-wind
- (lambda () #f)
- (lambda ()
- (do ((port (socket:accept socket)
- (socket:accept socket)))
- (#f)
+ (and (socket:bind socket port-number) ; AF_INET INADDR_ANY
+ (socket:listen socket 10) ; Queue up to 10 requests.
(dynamic-wind
- (lambda () #f)
- (lambda ()
- (fluid-let ((*html:output-port* port))
- (http:serve-query
- port port
- (lambda (query-string header)
- (http:send-header
- '(("Content-Type" . "text/plain")))
- (with-output-to-port port
- (lambda ()
- (serve-urlencoded-command
- build '*commands* query-string)))))))
- (lambda () (close-port port)))))
- (lambda () (close-port socket)))
+ (lambda () #f)
+ (lambda ()
+ (do ((port (socket:accept socket) (socket:accept socket)))
+ (#f)
+ (let ((iport (duplicate-port port "r"))
+ (oport (duplicate-port port "w")))
+ (http:serve-query build:serve iport oport)
+ (close-port iport)
+ (close-port oport))
+ (close-port port)))
+ (lambda () (close-port socket))))
+
+ - Function: cgi:serve-query serve-proc
+ reads the "URI" and "query-string" from `(current-input-port)'.
+ If the query is a valid `"POST"' or `"GET"' query, then
+ `cgi:serve-query' calls SERVE-PROC with three arguments, the
+ REQUEST-LINE, QUERY-STRING, and HEADER-ALIST. Otherwise,
+ `cgi:serve-query' calls SERVE-PROC with the REQUEST-LINE, #f, and
+ HEADER-ALIST.
+
+ If SERVE-PROC returns a string, it is sent to
+ `(current-input-port)'. If SERVE-PROC returns a list, then an
+ error page with number 525 and strings from the list. If
+ SERVE-PROC returns #f, then a `Bad Request' (400) page is sent to
+ `(current-input-port)'.
+
+ Otherwise, `cgi:serve-query' replies (to `(current-input-port)')
+ with appropriate HTML describing the problem.
+
+ - Function: make-query-alist-command-server rdb command-table
+ - Function: make-query-alist-command-server rdb command-table #t
+ Returns a procedure of one argument. When that procedure is called
+ with a QUERY-ALIST (as returned by `uri:decode-query', the value
+ of the `*command*' association will be the command invoked in
+ COMMAND-TABLE. If `*command*' is not in the QUERY-ALIST then the
+ value of `*suggest*' is tried. If neither name is in the
+ QUERY-ALIST, then the literal value `*default*' is tried in
+ COMMAND-TABLE.
+
+ If optional third argument is non-false, then the command is called
+ with just the parameter-list; otherwise, command is called with the
+ arguments described in its table.
+
+
+File: slib.info, Node: URI, Next: Printing Scheme, Prev: HTTP and CGI, Up: Textual Conversion Packages
+
+URI
+===
+
+ `(require 'uri)'
+
+Implements "Uniform Resource Identifiers" (URI) as described in RFC
+2396.
+
+ - Function: make-uri
+ - Function: make-uri fragment
+ - Function: make-uri query fragment
+ - Function: make-uri path query fragment
+ - Function: make-uri authority path query fragment
+ - Function: make-uri scheme authority path query fragment
+ Returns a Uniform Resource Identifier string from component
+ arguments.
- - Function: http:read-request-line PORT
- Reads the first non-blank line from PORT and, if successful,
- returns a list of three itmes from the request-line:
+ - Function: html:anchor name
+ Returns a string which defines this location in the (HTML) file as
+ NAME. The hypertext `<A HREF="#NAME">' will link to this point.
- 0. Method
+ (html:anchor "(section 7)")
+ =>
+ "<A NAME=\"(section%207)\"></A>"
- Either one of the symbols `options', `get', `head', `post',
- `put', `delete', or `trace'; Or a string.
+ - Function: html:link uri highlighted
+ Returns a string which links the HIGHLIGHTED text to URI.
- 1. Request-URI
+ (html:link (make-uri "(section 7)") "section 7")
+ =>
+ "<A HREF=\"#(section%207)\">section 7</A>"
+
+ - Function: html:base uri
+ Returns a string specifying the "base" URI of a document, for
+ inclusion in the HEAD of the document (*note head: HTML.).
- A string. At the minimum, it will be the string `"/"'.
+ - Function: html:isindex prompt
+ Returns a string specifying the search PROMPT of a document, for
+ inclusion in the HEAD of the document (*note head: HTML.).
- 2. HTTP-Version
+ - Function: uri->tree uri-reference base-tree ...
+ Returns a list of 5 elements corresponding to the parts (SCHEME
+ AUTHORITY PATH QUERY FRAGMENT) of string URI-REFERENCE. Elements
+ corresponding to absent parts are #f.
- A string. For example, `HTTP/1.0'.
+ The PATH is a list of strings. If the first string is empty, then
+ the path is absolute; otherwise relative.
- - Function: cgi:read-query-string
- Reads the "query-string" from `(current-input-port)'.
- `cgi:read-query-string' reads a `"POST"' or `"GET"' queries,
- depending on the value of `(getenv "REQUEST_METHOD")'.
+ If the AUTHORITY component is a "Server-based Naming Authority",
+ then it is a list of the USERINFO, HOST, and PORT strings (or #f).
+ For other types of AUTHORITY components the AUTHORITY will be a
+ string.
+
+ (uri->tree "http://www.ics.uci.edu/pub/ietf/uri/#Related")
+ =>
+ (http "www.ics.uci.edu" ("" "pub" "ietf" "uri" "") #f "Related")
+
+`uric:' prefixes indicate procedures dealing with URI-components.
+
+ - Function: uric:encode uri-component allows
+ Returns a copy of the string URI-COMPONENT in which all "unsafe"
+ octets (as defined in RFC 2396) have been `%' "escaped".
+ `uric:decode' decodes strings encoded by `uric:encode'.
+
+ - Function: uric:decode uri-component
+ Returns a copy of the string URI-COMPONENT in which each `%'
+ escaped characters in URI-COMPONENT is replaced with the character
+ it encodes. This routine is useful for showing URI contents on
+ error pages.

-File: slib.info, Node: Printing Scheme, Next: Time and Date, Prev: HTML HTTP and CGI, Up: Textual Conversion Packages
+File: slib.info, Node: Printing Scheme, Next: Time and Date, Prev: URI, Up: Textual Conversion Packages
Printing Scheme
===============
@@ -4035,7 +4385,7 @@ prints it. The interface to the procedure is sufficiently general to
easily implement other useful formatting procedures such as pretty
printing, output to a string and truncated output.
- - Procedure: generic-write OBJ DISPLAY? WIDTH OUTPUT
+ - Procedure: generic-write obj display? width output
OBJ
Scheme data value to transform.
@@ -4073,10 +4423,10 @@ Object-To-String
`(require 'object->string)'
- - Function: object->string OBJ
+ - Function: object->string obj
Returns the textual representation of OBJ as a string.
- - Function: object->limited-string OBJ LIMIT
+ - Function: object->limited-string obj limit
Returns the textual representation of OBJ as a string of length at
most LIMIT.
@@ -4088,8 +4438,8 @@ Pretty-Print
`(require 'pretty-print)'
- - Procedure: pretty-print OBJ
- - Procedure: pretty-print OBJ PORT
+ - Procedure: pretty-print obj
+ - Procedure: pretty-print obj port
`pretty-print's OBJ on PORT. If PORT is not specified,
`current-output-port' is used.
@@ -4102,16 +4452,54 @@ Pretty-Print
-| (16 17 18 19 20)
-| (21 22 23 24 25))
+ - Procedure: pretty-print->string obj
+ - Procedure: pretty-print->string obj width
+ Returns the string of OBJ `pretty-print'ed in WIDTH columns. If
+ WIDTH is not specified, `(output-port-width)' is used.
+
+ Example:
+ (pretty-print->string '((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15)
+ (16 17 18 19 20) (21 22 23 24 25)))
+ =>
+ "((1 2 3 4 5)
+ (6 7 8 9 10)
+ (11 12 13 14 15)
+ (16 17 18 19 20)
+ (21 22 23 24 25))
+ "
+ (pretty-print->string '((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15)
+ (16 17 18 19 20) (21 22 23 24 25))
+ 16)
+ =>
+ "((1 2 3 4 5)
+ (6 7 8 9 10)
+ (11
+ 12
+ 13
+ 14
+ 15)
+ (16
+ 17
+ 18
+ 19
+ 20)
+ (21
+ 22
+ 23
+ 24
+ 25))
+ "
+
`(require 'pprint-file)'
- - Procedure: pprint-file INFILE
- - Procedure: pprint-file INFILE OUTFILE
+ - Procedure: pprint-file infile
+ - Procedure: pprint-file infile outfile
Pretty-prints all the code in INFILE. If OUTFILE is specified,
the output goes to OUTFILE, otherwise it goes to
`(current-output-port)'.
- - Function: pprint-filter-file INFILE PROC OUTFILE
- - Function: pprint-filter-file INFILE PROC
+ - Function: pprint-filter-file infile proc outfile
+ - Function: pprint-filter-file infile proc
INFILE is a port or a string naming an existing file. Scheme
source code expressions and definitions are read from the port (or
file) and PROC is applied to them sequentially.
@@ -4157,11 +4545,11 @@ Scheme datatypes.
reference time for `get-universal-time' in *Note Common-Lisp
Time::.
- - Function: difftime CALTIME1 CALTIME0
+ - Function: difftime caltime1 caltime0
Returns the difference (number of seconds) between twe calendar
times: CALTIME1 - CALTIME0. CALTIME0 may also be a number.
- - Function: offset-time CALTIME OFFSET
+ - Function: offset-time caltime offset
Returns the calendar time of CALTIME offset by OFFSET number of
seconds `(+ caltime offset)'.
@@ -4232,12 +4620,12 @@ Time Zone
local time is, and the "Daylight Savings Time" rules for changing
it.
- - Function: time-zone TZ-STRING
+ - Function: time-zone TZ-string
Creates and returns a time-zone object specified by the string
TZ-STRING. If `time-zone' cannot interpret TZ-STRING, `#f' is
returned.
- - Function: tz:params CALTIME TZ
+ - Function: tz:params caltime tz
TZ is a time-zone object. `tz:params' returns a list of three
items:
0. An integer. 0 if standard time is in effect for timezone TZ
@@ -4259,16 +4647,16 @@ compatability. Because of shared state they are not thread-safe.
- Function: tzset
Returns the default time-zone.
- - Function: tzset TZ
+ - Function: tzset tz
Sets (and returns) the default time-zone to TZ.
- - Function: tzset TZ-STRING
+ - Function: tzset TZ-string
Sets (and returns) the default time-zone to that specified by
TZ-STRING.
`tzset' also sets the variables *TIMEZONE*, DAYLIGHT?, and TZNAME.
This function is automatically called by the time conversion
- procedures which depend on the time zone (*note Time and Date::.).
+ procedures which depend on the time zone (*note Time and Date::).
- Variable: *timezone*
Contains the difference, in seconds, between Greenwich Mean Time
@@ -4278,7 +4666,7 @@ compatability. Because of shared state they are not thread-safe.
- Variable: daylight?
is `#t' if the default timezone has rules for "Daylight Savings
- Time". *Note:* DAYLIGHT? does not tell you when Daylight Savings
+ Time". _Note:_ DAYLIGHT? does not tell you when Daylight Savings
Time is in effect, just that the default zone sometimes has
Daylight Savings Time.
@@ -4321,13 +4709,13 @@ Posix Time
8. 1 for daylight savings, 0 for regular time
- - Function: gmtime CALTIME
+ - Function: gmtime caltime
Converts the calendar time CALTIME to UTC and returns it.
- - Function: localtime CALTIME TZ
+ - Function: localtime caltime tz
Returns CALTIME converted to UTC relative to timezone TZ.
- - Function: localtime CALTIME
+ - Function: localtime caltime
converts the calendar time CALTIME to a vector of integers
expressed relative to the user's time zone. `localtime' sets the
variable *TIMEZONE* with the difference between Coordinated
@@ -4335,26 +4723,26 @@ Posix Time
tzset: Time Zone.).
- - Function: gmktime UNIVTIME
+ - Function: gmktime univtime
Converts a vector of integers in GMT Coordinated Universal Time
(UTC) format to a calendar time.
- - Function: mktime UNIVTIME
+ - Function: mktime univtime
Converts a vector of integers in local Coordinated Universal Time
(UTC) format to a calendar time.
- - Function: mktime UNIVTIME TZ
+ - Function: mktime univtime tz
Converts a vector of integers in Coordinated Universal Time (UTC)
format (relative to time-zone TZ) to calendar time.
- - Function: asctime UNIVTIME
+ - Function: asctime univtime
Converts the vector of integers CALTIME in Coordinated Universal
Time (UTC) format into a string of the form `"Wed Jun 30 21:49:08
1993"'.
- - Function: gtime CALTIME
- - Function: ctime CALTIME
- - Function: ctime CALTIME TZ
+ - Function: gtime caltime
+ - Function: ctime caltime
+ - Function: ctime caltime tz
Equivalent to `(asctime (gmtime CALTIME))', `(asctime (localtime
CALTIME))', and `(asctime (localtime CALTIME TZ))', respectively.
@@ -4372,7 +4760,7 @@ Common-Lisp Time
since 00:00:00 Jan 1, 1900 GMT. Note that the reference time is
different from `current-time'.
- - Function: decode-universal-time UNIVTIME
+ - Function: decode-universal-time univtime
Converts UNIVTIME to "Decoded Time" format. Nine values are
returned:
0. seconds (0 - 61)
@@ -4397,9 +4785,9 @@ Common-Lisp Time
Notice that the values returned by `decode-universal-time' do not
match the arguments to `encode-universal-time'.
- - Function: encode-universal-time SECOND MINUTE HOUR DATE MONTH YEAR
- - Function: encode-universal-time SECOND MINUTE HOUR DATE MONTH YEAR
- TIME-ZONE
+ - Function: encode-universal-time second minute hour date month year
+ - Function: encode-universal-time second minute hour date month year
+ time-zone
Converts the arguments in Decoded Time format to Universal Time
format. If TIME-ZONE is not specified, the returned time is
adjusted for daylight saving time. Otherwise, no adjustment is
@@ -4424,7 +4812,7 @@ File: slib.info, Node: Tektronix Graphics Support, Prev: Vector Graphics, Up:
Tektronix Graphics Support
--------------------------
- *Note:* The Tektronix graphics support files need more work, and are
+ _Note:_ The Tektronix graphics support files need more work, and are
not complete.
Tektronix 4000 Series Graphics
@@ -4444,13 +4832,13 @@ sequences.
- Procedure: tek40:text
- - Procedure: tek40:linetype LINETYPE
+ - Procedure: tek40:linetype linetype
- - Procedure: tek40:move X Y
+ - Procedure: tek40:move x y
- - Procedure: tek40:draw X Y
+ - Procedure: tek40:draw x y
- - Procedure: tek40:put-text X Y STR
+ - Procedure: tek40:put-text x y str
- Procedure: tek40:reset
@@ -4467,15 +4855,15 @@ sequences.
- Procedure: tek41:graphics
- - Procedure: tek41:move X Y
+ - Procedure: tek41:move x y
- - Procedure: tek41:draw X Y
+ - Procedure: tek41:draw x y
- - Procedure: tek41:point X Y NUMBER
+ - Procedure: tek41:point x y number
- - Procedure: tek41:encode-x-y X Y
+ - Procedure: tek41:encode-x-y x y
- - Procedure: tek41:encode-int NUMBER
+ - Procedure: tek41:encode-int number

File: slib.info, Node: Schmooz, Prev: Vector Graphics, Up: Textual Conversion Packages
@@ -4492,16 +4880,16 @@ imported into the documentation using the Texinfo command `@include'.
process files. Files containing schmooz documentation should not
contain `(require 'schmooz)'.
- - Procedure: schmooz FILENAMEscm ...
+ - Procedure: schmooz filenamescm ...
FILENAMEscm should be a string ending with `scm' naming an
existing file containing Scheme source code. `schmooz' extracts
top-level comments containing schmooz commands from FILENAMEscm
and writes the converted Texinfo source to a file named
FILENAMEtxi.
- - Procedure: schmooz FILENAMEtexi ...
- - Procedure: schmooz FILENAMEtex ...
- - Procedure: schmooz FILENAMEtxi ...
+ - Procedure: schmooz filenametexi ...
+ - Procedure: schmooz filenametex ...
+ - Procedure: schmooz filenametxi ...
FILENAME should be a string naming an existing file containing
Texinfo source code. For every occurrence of the string `@include
FILENAMEtxi' within that file, `schmooz' calls itself with the
@@ -4510,7 +4898,7 @@ contain `(require 'schmooz)'.
Schmooz comments are distinguished (from non-schmooz comments) by
their first line, which must start with an at-sign (@) preceded by one
or more semicolons (;). A schmooz comment ends at the first subsequent
-line which does *not* start with a semicolon. Currently schmooz
+line which does _not_ start with a semicolon. Currently schmooz
comments are recognized only at top level.
Schmooz comments are copied to the Texinfo output file with the
@@ -4592,6 +4980,7 @@ Mathematical Packages
* Cyclic Checksum:: 'make-crc
* Plotting:: 'charplot
* Root Finding:: 'root
+* Minimizing:: 'minimize
* Commutative Rings:: 'commutative-ring
* Determinant:: 'determinant
@@ -4612,7 +5001,7 @@ representation.
Bitwise Operations
------------------
- - Function: logand N1 N1
+ - Function: logand n1 n1
Returns the integer which is the bit-wise AND of the two integer
arguments.
@@ -4620,7 +5009,7 @@ Bitwise Operations
(number->string (logand #b1100 #b1010) 2)
=> "1000"
- - Function: logior N1 N2
+ - Function: logior n1 n2
Returns the integer which is the bit-wise OR of the two integer
arguments.
@@ -4628,7 +5017,7 @@ Bitwise Operations
(number->string (logior #b1100 #b1010) 2)
=> "1110"
- - Function: logxor N1 N2
+ - Function: logxor n1 n2
Returns the integer which is the bit-wise XOR of the two integer
arguments.
@@ -4636,7 +5025,7 @@ Bitwise Operations
(number->string (logxor #b1100 #b1010) 2)
=> "110"
- - Function: lognot N
+ - Function: lognot n
Returns the integer which is the 2s-complement of the integer
argument.
@@ -4646,19 +5035,19 @@ Bitwise Operations
(number->string (lognot #b0) 2)
=> "-1"
- - Function: bitwise-if MASK N0 N1
+ - Function: bitwise-if mask n0 n1
Returns an integer composed of some bits from integer N0 and some
from integer N1. A bit of the result is taken from N0 if the
corresponding bit of integer MASK is 1 and from N1 if that bit of
MASK is 0.
- - Function: logtest J K
+ - Function: logtest j k
(logtest j k) == (not (zero? (logand j k)))
(logtest #b0100 #b1011) => #f
(logtest #b0100 #b0111) => #t
- - Function: logcount N
+ - Function: logcount n
Returns the number of bits in integer N. If integer is positive,
the 1-bits in its binary representation are counted. If negative,
the 0-bits in its two's-complement binary representation are
@@ -4675,7 +5064,7 @@ Bitwise Operations
Bit Within Word
---------------
- - Function: logbit? INDEX J
+ - Function: logbit? index j
(logbit? index j) == (logtest (integer-expt 2 index) j)
(logbit? 0 #b1101) => #t
@@ -4684,7 +5073,7 @@ Bit Within Word
(logbit? 3 #b1101) => #t
(logbit? 4 #b1101) => #f
- - Function: copy-bit INDEX FROM BIT
+ - Function: copy-bit index from bit
Returns an integer the same as FROM except in the INDEXth bit,
which is 1 if BIT is `#t' and 0 if BIT is `#f'.
@@ -4696,7 +5085,7 @@ Bit Within Word
Fields of Bits
--------------
- - Function: bit-field N START END
+ - Function: bit-field n start end
Returns the integer composed of the START (inclusive) through END
(exclusive) bits of N. The STARTth bit becomes the 0-th bit in
the result.
@@ -4710,7 +5099,7 @@ Fields of Bits
(number->string (bit-field #b1101101010 4 9) 2)
=> "10110"
- - Function: copy-bit-field TO START END FROM
+ - Function: copy-bit-field to start end from
Returns an integer the same as TO except possibly in the START
(inclusive) through END (exclusive) bits, which are the same as
those of FROM. The 0-th bit of FROM becomes the STARTth bit of
@@ -4722,7 +5111,7 @@ Fields of Bits
(number->string (copy-bit-field #b1101101010 0 4 -1) 2)
=> "1101101111"
- - Function: ash INT COUNT
+ - Function: ash int count
Returns an integer equivalent to `(inexact->exact (floor (* INT
(expt 2 COUNT))))'.
@@ -4732,7 +5121,7 @@ Fields of Bits
(number->string (ash #b1010 -1) 2)
=> "101"
- - Function: integer-length N
+ - Function: integer-length n
Returns the number of bits neccessary to represent N.
Example:
@@ -4743,7 +5132,7 @@ Fields of Bits
(integer-length #b1111)
=> 4
- - Function: integer-expt N K
+ - Function: integer-expt n k
Returns N raised to the non-negative integer exponent K.
Example:
@@ -4760,18 +5149,18 @@ Modular Arithmetic
`(require 'modular)'
- - Function: extended-euclid N1 N2
+ - Function: extended-euclid n1 n2
Returns a list of 3 integers `(d x y)' such that d = gcd(N1, N2) =
N1 * x + N2 * y.
- - Function: symmetric:modulus N
+ - Function: symmetric:modulus n
Returns `(quotient (+ -1 n) -2)' for positive odd integer N.
- - Function: modulus->integer MODULUS
+ - Function: modulus->integer modulus
Returns the non-negative integer characteristic of the ring formed
when MODULUS is used with `modular:' procedures.
- - Function: modular:normalize MODULUS N
+ - Function: modular:normalize modulus n
Returns the integer `(modulo N (modulus->integer MODULUS))' in the
representation specified by MODULUS.
@@ -4792,30 +5181,30 @@ For all of these functions, if the first argument (MODULUS) is:
If all the arguments are fixnums the computation will use only fixnums.
- - Function: modular:invertable? MODULUS K
+ - Function: modular:invertable? modulus k
Returns `#t' if there exists an integer n such that K * n == 1 mod
MODULUS, and `#f' otherwise.
- - Function: modular:invert MODULUS K2
+ - Function: modular:invert modulus k2
Returns an integer n such that 1 = (n * K2) mod MODULUS. If K2
has no inverse mod MODULUS an error is signaled.
- - Function: modular:negate MODULUS K2
+ - Function: modular:negate modulus k2
Returns (-K2) mod MODULUS.
- - Function: modular:+ MODULUS K2 K3
+ - Function: modular:+ modulus k2 k3
Returns (K2 + K3) mod MODULUS.
- - Function: modular:- MODULUS K2 K3
+ - Function: modular:- modulus k2 k3
Returns (K2 - K3) mod MODULUS.
- - Function: modular:* MODULUS K2 K3
+ - Function: modular:* modulus k2 k3
Returns (K2 * K3) mod MODULUS.
The Scheme code for `modular:*' with negative MODULUS is not
completed for fixnum-only implementations.
- - Function: modular:expt MODULUS K2 K3
+ - Function: modular:expt modulus k2 k3
Returns (K2 ^ K3) mod MODULUS.

@@ -4827,18 +5216,17 @@ Prime Numbers
`(require 'factor)'
- Variable: prime:prngs
- PRIME:PRNGS is the random-state (*note Random Numbers::.) used by
- these procedures. If you call these procedures from more than one |
- thread (or from interrupt), `random' may complain about reentrant |
- calls. |
- |
- *Note:* The prime test and generation procedures implement (or use) |
-the Solovay-Strassen primality test. See |
- |
- * Robert Solovay and Volker Strassen, `A Fast Monte-Carlo Test for |
- Primality', SIAM Journal on Computing, 1977, pp 84-85. |
+ PRIME:PRNGS is the random-state (*note Random Numbers::) used by
+ these procedures. If you call these procedures from more than one
+ thread (or from interrupt), `random' may complain about reentrant
+ calls.
+ _Note:_ The prime test and generation procedures implement (or use)
+the Solovay-Strassen primality test. See
+
+ * Robert Solovay and Volker Strassen, `A Fast Monte-Carlo Test for
+ Primality', SIAM Journal on Computing, 1977, pp 84-85.
- - Function: jacobi-symbol P Q
+ - Function: jacobi-symbol p q
Returns the value (+1, -1, or 0) of the Jacobi-Symbol of exact
non-negative integer P and exact positive odd integer Q.
@@ -4846,20 +5234,20 @@ the Solovay-Strassen primality test. See |
PRIME:TRIALS the maxinum number of iterations of Solovay-Strassen
that will be done to test a number for primality.
- - Function: prime? N
+ - Function: prime? n
Returns `#f' if N is composite; `#t' if N is prime. There is a
slight chance `(expt 2 (- prime:trials))' that a composite will
return `#t'.
- - Function: primes< START COUNT
+ - Function: primes< start count
Returns a list of the first COUNT prime numbers less than START.
If there are fewer than COUNT prime numbers less than START, then
the returned list will have fewer than START elements.
- - Function: primes> START COUNT
+ - Function: primes> start count
Returns a list of the first COUNT prime numbers greater than START.
- - Function: factor K
+ - Function: factor k
Returns a list of the prime factors of K. The order of the
factors is unspecified. In order to obtain a sorted list do
`(sort! (factor K) <)'.
@@ -4875,17 +5263,17 @@ Random Numbers
A pseudo-random number generator is only as good as the tests it
passes. George Marsaglia of Florida State University developed a
battery of tests named "DIEHARD"
-(`http://stat.fsu.edu/~geo/diehard.html'). `diehard.c' has a bug which
-the patch |
-`http://swissnet.ai.mit.edu/ftpdir/users/jaffer/diehard.c.pat' corrects. |
+(<http://stat.fsu.edu/~geo/diehard.html>). `diehard.c' has a bug which
+the patch
+<http://swissnet.ai.mit.edu/ftpdir/users/jaffer/diehard.c.pat> corrects.
SLIB's new PRNG generates 8 bits at a time. With the degenerate seed
`0', the numbers generated pass DIEHARD; but when bits are combined
from sequential bytes, tests fail. With the seed
`http://swissnet.ai.mit.edu/~jaffer/SLIB.html', all of those tests pass.
- - Function: random N
- - Function: random N STATE
+ - Function: random n
+ - Function: random n state
Accepts a positive integer or real N and returns a number of the
same type between zero (inclusive) and N (exclusive). The values
returned by `random' are uniformly distributed from 0 to N.
@@ -4904,13 +5292,13 @@ from sequential bytes, tests fail. With the seed
function correctly as a random-number state object in another
implementation.
- - Function: copy-random-state STATE
+ - Function: copy-random-state state
Returns a new copy of argument STATE.
- Function: copy-random-state
Returns a new copy of `*random-state*'.
- - Function: seed->random-state SEED
+ - Function: seed->random-state seed
Returns a new object of type suitable for use as the value of the
variable `*random-state*' or as a second argument to `random'.
The number or string SEED is used to initialize the state. If
@@ -4920,7 +5308,7 @@ from sequential bytes, tests fail. With the seed
always return unequal states.
- Function: make-random-state
- - Function: make-random-state OBJ
+ - Function: make-random-state obj
Returns a new object of type suitable for use as the value of the
variable `*random-state*' or as a second argument to `random'. If
the optional argument OBJ is given, it should be a printable
@@ -4933,43 +5321,43 @@ from sequential bytes, tests fail. With the seed
procedures for generating inexact distributions.
- Function: random:uniform
- - Function: random:uniform STATE
+ - Function: random:uniform state
Returns an uniformly distributed inexact real random number in the
range between 0 and 1.
- Function: random:exp
- - Function: random:exp STATE
+ - Function: random:exp state
Returns an inexact real in an exponential distribution with mean
1. For an exponential distribution with mean U use
`(* U (random:exp))'.
- Function: random:normal
- - Function: random:normal STATE
+ - Function: random:normal state
Returns an inexact real in a normal distribution with mean 0 and
standard deviation 1. For a normal distribution with mean M and
standard deviation D use `(+ M (* D (random:normal)))'.
- - Function: random:normal-vector! VECT
- - Function: random:normal-vector! VECT STATE
+ - Function: random:normal-vector! vect
+ - Function: random:normal-vector! vect state
Fills VECT with inexact real random numbers which are independent
and standard normally distributed (i.e., with mean 0 and variance
1).
- - Function: random:hollow-sphere! VECT
- - Function: random:hollow-sphere! VECT STATE
+ - Function: random:hollow-sphere! vect
+ - Function: random:hollow-sphere! vect state
+ Fills VECT with inexact real random numbers the sum of whose
+ squares is equal to 1.0. Thinking of VECT as coordinates in space
+ of dimension n = `(vector-length VECT)', the coordinates are
+ uniformly distributed over the surface of the unit n-shere.
+
+ - Function: random:solid-sphere! vect
+ - Function: random:solid-sphere! vect state
Fills VECT with inexact real random numbers the sum of whose
squares is less than 1.0. Thinking of VECT as coordinates in
space of dimension N = `(vector-length VECT)', the coordinates are
uniformly distributed within the unit N-shere. The sum of the
squares of the numbers is returned.
- - Function: random:solid-sphere! VECT
- - Function: random:solid-sphere! VECT STATE
- Fills VECT with inexact real random numbers the sum of whose
- squares is equal to 1.0. Thinking of VECT as coordinates in space
- of dimension n = `(vector-length VECT)', the coordinates are
- uniformly distributed over the surface of the unit n-shere.
-

File: slib.info, Node: Fast Fourier Transform, Next: Cyclic Checksum, Prev: Random Numbers, Up: Mathematical Packages
@@ -4978,12 +5366,12 @@ Fast Fourier Transform
`(require 'fft)'
- - Function: fft ARRAY
+ - Function: fft array
ARRAY is an array of `(expt 2 n)' numbers. `fft' returns an array
of complex numbers comprising the "Discrete Fourier Transform" of
ARRAY.
- - Function: fft-1 ARRAY
+ - Function: fft-1 array
`fft-1' returns an array of complex numbers comprising the inverse
Discrete Fourier Transform of ARRAY.
@@ -5008,8 +5396,7 @@ Cyclic Checksum
`(require 'make-crc)'
- Function: make-port-crc
- - Function: make-port-crc DEGREE
- - Function: make-port-crc DEGREE GENERATOR
+ - Function: make-port-crc degree
Returns an expression for a procedure of one argument, a port.
This procedure reads characters from the port until the end of
file and returns the integer checksum of the bytes read.
@@ -5018,6 +5405,12 @@ Cyclic Checksum
polynomial being computed - which is also the number of bits
computed in the checksums. The default value is 32.
+ - Function: make-port-crc generator
+ The integer GENERATOR specifies the polynomial being computed.
+ The power of 2 generating each 1 bit is the exponent of a term of
+ the polynomial. The value of GENERATOR must be larger than 127.
+
+ - Function: make-port-crc degree generator
The integer GENERATOR specifies the polynomial being computed.
The power of 2 generating each 1 bit is the exponent of a term of
the polynomial. The bit at position DEGREE is implicit and should
@@ -5041,7 +5434,7 @@ Cyclic Checksum
(define (file-check-sum file) (call-with-input-file file crc32))
(file-check-sum (in-vicinity (library-vicinity) "ratize.scm"))
- => 3553047446
+ => 157103930

File: slib.info, Node: Plotting, Next: Root Finding, Prev: Cyclic Checksum, Up: Mathematical Packages
@@ -5061,7 +5454,7 @@ Plotting on Character Devices
- Variable: charplot:width
The number of columns to make the plot horizontally.
- - Procedure: plot! COORDS X-LABEL Y-LABEL
+ - Procedure: plot! coords x-label y-label
COORDS is a list of pairs of x and y coordinates. X-LABEL and
Y-LABEL are strings with which to label the x and y axes.
@@ -5082,33 +5475,39 @@ Plotting on Character Devices
| |
1|- **** |
| ** ** |
- 750.0e-3|- * * |
+ 0.75|- * * |
| * * |
- 500.0e-3|- * * |
+ 0.5|- * * |
| * |
- 250.0e-3|- * |
+ 0.25|- * |
| * * |
0|-------------------*--------------------------|
| * |
- -250.0e-3|- * * |
+ -0.25|- * * |
| * * |
- -500.0e-3|- * |
+ -0.5|- * |
| * * |
- -750.0e-3|- * * |
+ -0.75|- * * |
| ** ** |
-1|- **** |
|____________:_____._____:_____._____:_________|
- x 2 4
+ x 2 4 6
+
+ - Procedure: plot-function! func x1 x2
+ - Procedure: plot-function! func x1 x2 npts
+ Plots the function of one argument FUNC over the range X1 to X2.
+ If the optional integer argument NPTS is supplied, it specifies
+ the number of points to evaluate FUNC at.

-File: slib.info, Node: Root Finding, Next: Commutative Rings, Prev: Plotting, Up: Mathematical Packages
+File: slib.info, Node: Root Finding, Next: Minimizing, Prev: Plotting, Up: Mathematical Packages
Root Finding
============
`(require 'root)'
- - Function: newtown:find-integer-root F DF/DX X0
+ - Function: newtown:find-integer-root f df/dx x0
Given integer valued procedure F, its derivative (with respect to
its argument) DF/DX, and initial integer value X0 for which
DF/DX(X0) is non-zero, returns an integer X for which F(X) is
@@ -5125,11 +5524,11 @@ Root Finding
(integer-sqrt 15) => 4
- - Function: integer-sqrt Y
+ - Function: integer-sqrt y
Given a non-negative integer Y, returns the rounded square-root of
Y.
- - Function: newton:find-root F DF/DX X0 PREC
+ - Function: newton:find-root f df/dx x0 prec
Given real valued procedures F, DF/DX of one (real) argument,
initial real value X0 for which DF/DX(X0) is non-zero, and
positive real number PREC, returns a real X for which `abs'(F(X))
@@ -5146,7 +5545,7 @@ Polynomials', IEEE Transactions on Circuits and Systems, Vol. 36, No.
value of 1000+j0 should have Z_k of 1.0475 + j4.1036 and line k=2
for starting value of 0+j1000 should have Z_k of 1.0988 + j4.0833.
- - Function: laguerre:find-root F DF/DZ DDF/DZ^2 Z0 PREC
+ - Function: laguerre:find-root f df/dz ddf/dz^2 z0 prec
Given complex valued procedure F of one (complex) argument, its
derivative (with respect to its argument) DF/DX, its second
derivative DDF/DZ^2, initial complex value Z0, and positive real
@@ -5157,7 +5556,7 @@ Polynomials', IEEE Transactions on Circuits and Systems, Vol. 36, No.
If PREC is instead a negative integer, `laguerre:find-root'
returns the result of -PREC iterations.
- - Function: laguerre:find-polynomial-root DEG F DF/DZ DDF/DZ^2 Z0 PREC
+ - Function: laguerre:find-polynomial-root deg f df/dz ddf/dz^2 z0 prec
Given polynomial procedure F of integer degree DEG of one
argument, its derivative (with respect to its argument) DF/DX, its
second derivative DDF/DZ^2, initial complex value Z0, and positive
@@ -5169,8 +5568,8 @@ Polynomials', IEEE Transactions on Circuits and Systems, Vol. 36, No.
`laguerre:find-polynomial-root' returns the result of -PREC
iterations.
- - Function: secant:find-root F X0 X1 PREC
- - Function: secant:find-bracketed-root F X0 X1 PREC
+ - Function: secant:find-root f x0 x1 prec
+ - Function: secant:find-bracketed-root f x0 x1 prec
Given a real valued procedure F and two real valued starting
points X0 and X1, returns a real X for which `(abs (f x))' is less
than PREC; or returns `#f' if such a real can't be found.
@@ -5196,7 +5595,54 @@ Polynomials', IEEE Transactions on Circuits and Systems, Vol. 36, No.
non-false if the iteration should be stopped.

-File: slib.info, Node: Commutative Rings, Next: Determinant, Prev: Root Finding, Up: Mathematical Packages
+File: slib.info, Node: Minimizing, Next: Commutative Rings, Prev: Root Finding, Up: Mathematical Packages
+
+Minimizing
+==========
+
+ `(require 'minimize)'
+
+The Golden Section Search (1) algorithm finds minima of functions which
+are expensive to compute or for which derivatives are not available.
+Although optimum for the general case, 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 the function is inexpensive to compute, consider
+approximating the derivative.
+
+ - Function: golden-section-search f x0 x1 prec
+ X_0 are X_1 real numbers. The (single argument) procedure F is
+ unimodal over the open interval (X_0, X_1). That is, there is
+ exactly one point in the interval for which the derivative of F is
+ zero.
+
+ `golden-section-search' returns a pair (X . F(X)) where F(X) is
+ the minimum. The PREC parameter is the 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)
+
+ ---------- Footnotes ----------
+
+ (1) David Kahaner, Cleve Moler, and Stephen Nash `Numerical Methods
+and Software' Prentice-Hall, 1989, ISBN 0-13-627258-4
+
+
+File: slib.info, Node: Commutative Rings, Next: Determinant, Prev: Minimizing, Up: Mathematical Packages
Commutative Rings
=================
@@ -5276,16 +5722,16 @@ through the use of "rulesets".
time `cring:define-rule' is called. If *RULESET* is `#f', then no
rules apply.
- - Function: make-ruleset RULE1 ...
- - Function: make-ruleset NAME RULE1 ...
+ - Function: make-ruleset rule1 ...
+ - Function: make-ruleset name rule1 ...
Returns a new ruleset containing the rules formed by applying
`cring:define-rule' to each 4-element list argument RULE. If the
first argument to `make-ruleset' is a symbol, then the database
table created for the new ruleset will be named NAME. Calling
`make-ruleset' with no rule arguments creates an empty ruleset.
- - Function: combined-rulesets RULESET1 ...
- - Function: combined-rulesets NAME RULESET1 ...
+ - Function: combined-rulesets ruleset1 ...
+ - Function: combined-rulesets name ruleset1 ...
Returns a new ruleset containing the rules contained in each
ruleset argument RULESET. If the first argument to
`combined-ruleset' is a symbol, then the database table created for
@@ -5310,14 +5756,14 @@ elements simplify by specifying the rules for `+' or `*' for cases
where expressions involving objects reduce to numbers or to expressions
involving different non-numeric elements.
- - Function: cring:define-rule OP SUB-OP1 SUB-OP2 REDUCTION
+ - Function: cring:define-rule op sub-op1 sub-op2 reduction
Defines a rule for the case when the operation represented by
symbol OP is applied to lists whose `car's are SUB-OP1 and
SUB-OP2, respectively. The argument REDUCTION is a procedure
accepting 2 arguments which will be lists whose `car's are SUB-OP1
and SUB-OP2.
- - Function: cring:define-rule OP SUB-OP1 'IDENTITY REDUCTION
+ - Function: cring:define-rule op sub-op1 'identity reduction
Defines a rule for the case when the operation represented by
symbol OP is applied to a list whose `car' is SUB-OP1, and some
other argument. REDUCTION will be called with the list whose
@@ -5367,7 +5813,7 @@ be the same symbol whose top-level value is the procedure to create it.
Define a procedure to multiply 2 non-numeric elements of the ring.
Other multiplicatons are handled automatically. Objects for which rules
-have *not* been defined are not changed.
+have _not_ been defined are not changed.
(define (n*n ni nj)
(let ((list1 (cdr ni)) (list2 (cdr nj)))
@@ -5480,10 +5926,13 @@ File: slib.info, Node: Determinant, Prev: Commutative Rings, Up: Mathematical
Determinant
===========
- (require 'determinant)
- (determinant '((1 2) (3 4))) => -2
- (determinant '((1 2 3) (4 5 6) (7 8 9))) => 0
- (determinant '((1 2 3 4) (5 6 7 8) (9 10 11 12))) => 0
+ - Function: determinant square-matrix
+ Returns the determinant of SQUARE-MATRIX.
+
+ (require 'determinant)
+ (determinant '((1 2) (3 4))) => -2
+ (determinant '((1 2 3) (4 5 6) (7 8 9))) => 0
+ (determinant '((1 2 3 4) (5 6 7 8) (9 10 11 12))) => 0

File: slib.info, Node: Database Packages, Next: Other Packages, Prev: Mathematical Packages, Up: Top
@@ -5529,7 +5978,7 @@ otherwise. For example:
(define foo (alist-table 'foo))
foo => #f
- - Function: make-base FILENAME KEY-DIMENSION COLUMN-TYPES
+ - Function: make-base filename key-dimension column-types
Returns a new, open, low-level database (collection of tables)
associated with FILENAME. This returned database has an empty
table associated with CATALOG-ID. The positive integer
@@ -5543,7 +5992,7 @@ otherwise. For example:
`#f' a temporary, non-disk based database will be created if such
can be supported by the base table implelentation.
- - Function: open-base FILENAME MUTABLE
+ - Function: open-base filename mutable
Returns an open low-level database associated with FILENAME. If
MUTABLE? is `#t', this database will have methods capable of
effecting change to the database. If MUTABLE? is `#f', only
@@ -5553,7 +6002,7 @@ otherwise. For example:
Calling the `close-base' (and possibly other) method on a MUTABLE?
database will cause FILENAME to be written to.
- - Function: write-base LLDB FILENAME
+ - Function: write-base lldb filename
Causes the low-level database LLDB to be written to FILENAME. If
the write is successful, also causes LLDB to henceforth be
associated with FILENAME. Calling the `close-database' (and
@@ -5563,20 +6012,20 @@ otherwise. For example:
underlying base table implelentation. If the operations completed
successfully, `#t' is returned. Otherwise, `#f' is returned.
- - Function: sync-base LLDB
+ - Function: sync-base lldb
Causes the file associated with the low-level database LLDB to be
updated to reflect its current state. If the associated filename
is `#f', no action is taken and `#f' is returned. If this
operation completes successfully, `#t' is returned. Otherwise,
`#f' is returned.
- - Function: close-base LLDB
+ - Function: close-base lldb
Causes the low-level database LLDB to be written to its associated
file (if any). If the write is successful, subsequent operations
to LLDB will signal an error. If the operations complete
successfully, `#t' is returned. Otherwise, `#f' is returned.
- - Function: make-table LLDB KEY-DIMENSION COLUMN-TYPES
+ - Function: make-table lldb key-dimension column-types
Returns the BASE-ID for a new base table, otherwise returns `#f'.
The base table can then be opened using `(open-table LLDB
BASE-ID)'. The positive integer KEY-DIMENSION is the number of
@@ -5588,7 +6037,7 @@ otherwise. For example:
`open-table'. CATALOG-ID will be used as the base table for the
system catalog.
- - Function: open-table LLDB BASE-ID KEY-DIMENSION COLUMN-TYPES
+ - Function: open-table lldb base-id key-dimension column-types
Returns a HANDLE for an existing base table in the low-level
database LLDB if that table exists and can be opened in the mode
indicated by MUTABLE?, otherwise returns `#f'.
@@ -5597,11 +6046,11 @@ otherwise. For example:
number of keys composed to make a PRIMARY-KEY for this table. The
list of symbols COLUMN-TYPES describes the types of each column.
- - Function: kill-table LLDB BASE-ID KEY-DIMENSION COLUMN-TYPES
+ - Function: kill-table lldb base-id key-dimension column-types
Returns `#t' if the base table associated with BASE-ID was removed
from the low level database LLDB, and `#f' otherwise.
- - Function: make-keyifier-1 TYPE
+ - Function: make-keyifier-1 type
Returns a procedure which accepts a single argument which must be
of type TYPE. This returned procedure returns an object suitable
for being a KEY argument in the functions whose descriptions
@@ -5611,7 +6060,7 @@ otherwise. For example:
function which are not `equal?' must result in returned values
which are not `equal?'.
- - Function: make-list-keyifier KEY-DIMENSION TYPES
+ - Function: make-list-keyifier key-dimension types
The list of symbols TYPES must have at least KEY-DIMENSION
elements. Returns a procedure which accepts a list of length
KEY-DIMENSION and whose types must corresopond to the types named
@@ -5624,26 +6073,26 @@ otherwise. For example:
which are not `equal?' must result in returned values which are not
`equal?'.
- - Function: make-key-extractor KEY-DIMENSION TYPES COLUMN-NUMBER
+ - Function: make-key-extractor key-dimension types column-number
Returns a procedure which accepts objects produced by application
of the result of `(make-list-keyifier KEY-DIMENSION TYPES)'. This
procedure returns a KEY which is `equal?' to the COLUMN-NUMBERth
element of the list which was passed to create COMBINED-KEY. The
list TYPES must have at least KEY-DIMENSION elements.
- - Function: make-key->list KEY-DIMENSION TYPES
+ - Function: make-key->list key-dimension types
Returns a procedure which accepts objects produced by application
of the result of `(make-list-keyifier KEY-DIMENSION TYPES)'. This
procedure returns a list of KEYs which are elementwise `equal?' to
the list which was passed to create COMBINED-KEY.
In the following functions, the KEY argument can always be assumed to
-be the value returned by a call to a *keyify* routine.
+be the value returned by a call to a _keyify_ routine.
-In contrast, a MATCH-KEY argument is a list of length equal to the
-number of primary keys. The MATCH-KEY restricts the actions of the
+In contrast, a MATCH-KEYS argument is a list of length equal to the
+number of primary keys. The MATCH-KEYS restrict the actions of the
table command to those records whose primary keys all satisfy the
-corresponding element of the MATCH-KEY list. The elements and their
+corresponding element of the MATCH-KEYS list. The elements and their
actions are:
`#f'
@@ -5658,53 +6107,59 @@ actions are:
other values
Any other value matches only those keys `equal?' to it.
- - Function: for-each-key HANDLE PROCEDURE MATCH-KEY
+The KEY-DIMENSION and COLUMN-TYPES arguments are needed to decode the
+combined-keys for matching with MATCH-KEYS.
+
+ - Function: for-each-key handle procedure key-dimension column-types
+ match-keys
Calls PROCEDURE once with each KEY in the table opened in HANDLE
- which satisfies MATCH-KEY in an unspecified order. An unspecified
+ which satisfy MATCH-KEYS in an unspecified order. An unspecified
value is returned.
- - Function: map-key HANDLE PROCEDURE MATCH-KEY
+ - Function: map-key handle procedure key-dimension column-types
+ match-keys
Returns a list of the values returned by calling PROCEDURE once
- with each KEY in the table opened in HANDLE which satisfies
- MATCH-KEY in an unspecified order.
+ with each KEY in the table opened in HANDLE which satisfy
+ MATCH-KEYS in an unspecified order.
- - Function: ordered-for-each-key HANDLE PROCEDURE MATCH-KEY
+ - Function: ordered-for-each-key handle procedure key-dimension
+ column-types match-keys
Calls PROCEDURE once with each KEY in the table opened in HANDLE
- which satisfies MATCH-KEY in the natural order for the types of
- the primary key fields of that table. An unspecified value is
+ which satisfy MATCH-KEYS in the natural order for the types of the
+ primary key fields of that table. An unspecified value is
returned.
- - Function: delete* HANDLE MATCH-KEY
- Removes all rows which satisfy MATCH-KEY from the table opened in
+ - Function: delete* handle key-dimension column-types match-keys
+ Removes all rows which satisfy MATCH-KEYS from the table opened in
HANDLE. An unspecified value is returned.
- - Function: present? HANDLE KEY
+ - Function: present? handle key
Returns a non-`#f' value if there is a row associated with KEY in
the table opened in HANDLE and `#f' otherwise.
- - Function: delete HANDLE KEY
+ - Function: delete handle key
Removes the row associated with KEY from the table opened in
HANDLE. An unspecified value is returned.
- - Function: make-getter KEY-DIMENSION TYPES
+ - Function: make-getter key-dimension types
Returns a procedure which takes arguments HANDLE and KEY. This
procedure returns a list of the non-primary values of the relation
(in the base table opened in HANDLE) whose primary key is KEY if
it exists, and `#f' otherwise.
- - Function: make-putter KEY-DIMENSION TYPES
+ - Function: make-putter key-dimension types
Returns a procedure which takes arguments HANDLE and KEY and
VALUE-LIST. This procedure associates the primary key KEY with
the values in VALUE-LIST (in the base table opened in HANDLE) and
returns an unspecified value.
- - Function: supported-type? SYMBOL
+ - Function: supported-type? symbol
Returns `#t' if SYMBOL names a type allowed as a column value by
the implementation, and `#f' otherwise. At a minimum, an
implementation must support the types `integer', `symbol',
`string', `boolean', and `base-id'.
- - Function: supported-key-type? SYMBOL
+ - Function: supported-key-type? symbol
Returns `#t' if SYMBOL names a type allowed as a key value by the
implementation, and `#f' otherwise. At a minimum, an
implementation must support the types `integer', and `symbol'.
@@ -5781,7 +6236,7 @@ program's author.
In order to address this need, the conscientious software engineer may
even provide a scripting language to allow users to make repetitive
database changes. Users will grumble that they need to read a large
-manual and learn yet another programming language (even if it *almost*
+manual and learn yet another programming language (even if it _almost_
has language "xyz" syntax) in order to do simple configuration.
All of these facilities need to be designed, coded, debugged,
@@ -5856,7 +6311,7 @@ File: slib.info, Node: Creating and Opening Relational Databases, Next: Relati
Creating and Opening Relational Databases
-----------------------------------------
- - Function: make-relational-system BASE-TABLE-IMPLEMENTATION
+ - Function: make-relational-system base-table-implementation
Returns a procedure implementing a relational database using the
BASE-TABLE-IMPLEMENTATION.
@@ -5879,7 +6334,7 @@ Creating and Opening Relational Databases
What follows are the descriptions of the methods available from
relational system returned by a call to `make-relational-system'.
- - Function: create-database FILENAME
+ - Function: create-database filename
Returns an open, nearly empty relational database associated with
FILENAME. The only tables defined are the system catalog and
domain table. Calling the `close-database' method on this database
@@ -5890,7 +6345,7 @@ relational system returned by a call to `make-relational-system'.
`#f' is returned. For the fields and layout of descriptor tables,
*Note Catalog Representation::
- - Function: open-database FILENAME MUTABLE?
+ - Function: open-database filename mutable?
Returns an open relational database associated with FILENAME. If
MUTABLE? is `#t', this database will have methods capable of
effecting change to the database. If MUTABLE? is `#f', only
@@ -5920,7 +6375,7 @@ the database with the symbol name of the operation. For example:
to this database will signal an error. If the operations completed
successfully, `#t' is returned. Otherwise, `#f' is returned.
- - Function: write-database FILENAME
+ - Function: write-database filename
Causes the relational database to be written to FILENAME. If the
write is successful, also causes the database to henceforth be
associated with FILENAME. Calling the `close-database' (and
@@ -5931,29 +6386,34 @@ the database with the symbol name of the operation. For example:
completed successfully, `#t' is returned. Otherwise, `#f' is
returned.
- - Function: table-exists? TABLE-NAME
+ - Function: sync-database
+ Causes any pending updates to the database file to be written out.
+ If the operations completed successfully, `#t' is returned.
+ Otherwise, `#f' is returned.
+
+ - Function: table-exists? table-name
Returns `#t' if TABLE-NAME exists in the system catalog, otherwise
returns `#f'.
- - Function: open-table TABLE-NAME MUTABLE?
+ - Function: open-table table-name mutable?
Returns a "methods" procedure for an existing relational table in
this database if it exists and can be opened in the mode indicated
by MUTABLE?, otherwise returns `#f'.
These methods will be present only in databases which are MUTABLE?.
- - Function: delete-table TABLE-NAME
+ - Function: delete-table table-name
Removes and returns the TABLE-NAME row from the system catalog if
the table or view associated with TABLE-NAME gets removed from the
database, and `#f' otherwise.
- - Function: create-table TABLE-DESC-NAME
+ - Function: create-table table-desc-name
Returns a methods procedure for a new (open) relational table for
describing the columns of a new base table in this database,
otherwise returns `#f'. For the fields and layout of descriptor
tables, *Note Catalog Representation::.
- - Function: create-table TABLE-NAME TABLE-DESC-NAME
+ - Function: create-table table-name table-desc-name
Returns a methods procedure for a new (open) relational table with
columns as described by TABLE-DESC-NAME, otherwise returns `#f'.
@@ -5998,7 +6458,7 @@ each column) in the order specified in the descriptor (table) for this
table. Missing values appear as `#f'. Primary keys must not be
missing.
- - Function: get COLUMN-NAME
+ - Function: get column-name
Returns a procedure of arguments KEY1 KEY2 ... which returns the
value for the COLUMN-NAME column of the row associated with
primary keys KEY1, KEY2 ... if that row exists in the table, or
@@ -6007,7 +6467,7 @@ missing.
((plat 'get 'processor) 'djgpp) => i386
((plat 'get 'processor) 'be-os) => #f
- - Function: get* COLUMN-NAME
+ - Function: get* column-name
Returns a procedure of optional arguments MATCH-KEY1 ... which
returns a list of the values for the specified column for all rows
in this table. The optional MATCH-KEY1 ... arguments restrict
@@ -6108,7 +6568,7 @@ missing.
restrict actions to a subset of the table. See the match-key
description below for details.
- *Real* relational programmers would use some least-upper-bound join
+ _Real_ relational programmers would use some least-upper-bound join
for every row to get them in order; But we don't have joins yet.
The (optional) MATCH-KEY1 ... arguments are used to restrict actions of
@@ -6189,7 +6649,7 @@ sufficient to distinguish all rows from each other in the table. All of
the system defined tables have a single primary key.
This package currently supports tables having from 1 to 4 primary keys
-if there are non-primary columns, and any (natural) number if *all*
+if there are non-primary columns, and any (natural) number if _all_
columns are primary keys. If you need more than 4 primary keys, I would
like to hear what you are doing!
@@ -6270,7 +6730,7 @@ Process scope
implementations.
Shared utilities with state
- Some shared utilities have state which should *not* be part of a
+ Some shared utilities have state which should _not_ be part of a
transaction. An example would be calling a pseudo-random number
generator. If the success of a transaction depended on the
pseudo-random number and failed, the state of the generator would
@@ -6309,13 +6769,13 @@ Also included are utilities which provide:
for any SLIB relational database.
- - Function: create-database FILENAME BASE-TABLE-TYPE
+ - Function: create-database filename base-table-type
Returns an open, nearly empty enhanced (with `*commands*' table)
relational database (with base-table type BASE-TABLE-TYPE)
associated with FILENAME.
- - Function: open-database FILENAME
- - Function: open-database FILENAME BASE-TABLE-TYPE
+ - Function: open-database filename
+ - Function: open-database filename base-table-type
Returns an open enchanced relational database associated with
FILENAME. The database will be opened with base-table type
BASE-TABLE-TYPE) if supplied. If BASE-TABLE-TYPE is not supplied,
@@ -6323,9 +6783,9 @@ for any SLIB relational database.
base-table-type. If the database can not be opened or if it lacks
the `*commands*' table, `#f' is returned.
- - Function: open-database! FILENAME
- - Function: open-database! FILENAME BASE-TABLE-TYPE
- Returns *mutable* open enchanced relational database ...
+ - Function: open-database! filename
+ - Function: open-database! filename base-table-type
+ Returns _mutable_ open enchanced relational database ...
The table `*commands*' in an "enhanced" relational-database has the
fields (with domains):
@@ -6377,7 +6837,7 @@ following fields:
parameters in the `index'th field must satisfy.
The `defaulter' field is an expression whose value is either `#f' or
-a procedure of one argument (the parameter-list) which returns a *list*
+a procedure of one argument (the parameter-list) which returns a _list_
of the default value or values as appropriate. Note that since the
`defaulter' procedure is called every time a default parameter is
needed for this column, "sticky" defaults can be implemented using
@@ -6393,10 +6853,10 @@ relational-database. A procedure should then be returned which the user
can invoke on (optional) arguments.
The command `*initialize*' is special. If present in the
-`*commands*' table, `open-database' or `open-database!' will return
-the value of the `*initialize*' command. Notice that arbitrary code
-can be run when the `*initialize*' procedure is automatically applied
-to the enhanced relational-database.
+`*commands*' table, `open-database' or `open-database!' will return the
+value of the `*initialize*' command. Notice that arbitrary code can be
+run when the `*initialize*' procedure is automatically applied to the
+enhanced relational-database.
Note also that if you wish to shadow or hide from the user
relational-database methods described in *Note Relational Database
@@ -6405,7 +6865,7 @@ the `*initialize*' expression rather than by entries in the
`*commands*' table if it is desired that the underlying methods remain
accessible to code in the `*commands*' table.
- - Function: make-command-server RDB TABLE-NAME
+ - Function: make-command-server rdb table-name
Returns a procedure of 2 arguments, a (symbol) command and a
call-back procedure. When this returned procedure is called, it
looks up COMMAND in table TABLE-NAME and calls the call-back
@@ -6452,7 +6912,7 @@ accessible to code in the `*commands*' table.
For information about parameters, *Note Parameter lists::. Here is an
example of setting up a command with arguments and parsing those
-arguments from a `getopt' style argument list (*note Getopt::.).
+arguments from a `getopt' style argument list (*note Getopt::).
(require 'database-utilities)
(require 'fluid-let)
@@ -6559,7 +7019,7 @@ arguments from a `getopt' style argument list (*note Getopt::.).
Some commands are defined in all extended relational-databases. The
are called just like *Note Relational Database Operations::.
- - Function: add-domain DOMAIN-ROW
+ - Function: add-domain domain-row
Adds DOMAIN-ROW to the "domains" table if there is no row in the
domains table associated with key `(car DOMAIN-ROW)' and returns
`#t'. Otherwise returns `#f'.
@@ -6588,17 +7048,17 @@ are called just like *Note Relational Database Operations::.
(filename #f #f string #f)
(build-whats #f #f symbol #f)))
- - Function: delete-domain DOMAIN-NAME
+ - Function: delete-domain domain-name
Removes and returns the DOMAIN-NAME row from the "domains" table.
- - Function: domain-checker DOMAIN
+ - Function: domain-checker domain
Returns a procedure to check an argument for conformance to domain
DOMAIN.
Defining Tables
...............
- - Procedure: define-tables RDB SPEC-0 ...
+ - Procedure: define-tables rdb spec-0 ...
Adds tables as specified in SPEC-0 ... to the open
relational-database RDB. Each SPEC has the form:
@@ -6691,6 +7151,18 @@ when the database is opened. The database is then closed and reopened.
-|
Welcome
+Listing Tables
+..............
+
+ - Procedure: list-table-definition rdb table-name
+ If symbol TABLE-NAME exists in the open relational-database RDB,
+ then returns a list of the table-name, its primary key names and
+ domains, its other key names and domains, and the table's records
+ (as lists). Otherwise, returns #f.
+
+ The list returned by `list-table-definition', when passed as an
+ argument to `define-tables', will recreate the table.
+

File: slib.info, Node: Database Reports, Next: Database Browser, Prev: Database Utilities, Up: Relational Database
@@ -6702,8 +7174,8 @@ it using `format', I discovered that Common-Lisp `format' is not
useable for this application because there is no mechanismm for
truncating fields. `report.scm' needs to be rewritten using `printf'.
- - Procedure: create-report RDB DESTINATION REPORT-NAME TABLE
- - Procedure: create-report RDB DESTINATION REPORT-NAME
+ - Procedure: create-report rdb destination report-name table
+ - Procedure: create-report rdb destination report-name
The symbol REPORT-NAME must be primary key in the table named
`*reports*' in the relational database RDB. DESTINATION is a
port, string, or symbol. If DESTINATION is a:
@@ -6721,7 +7193,7 @@ truncating fields. `report.scm' needs to be rewritten using `printf'.
The report is prepared as follows:
- * `Format' (*note Format::.) is called with the `header' field
+ * `Format' (*note Format::) is called with the `header' field
and the (list of) `column-names' of the table.
* `Format' is called with the `reporter' field and (on
@@ -6779,26 +7251,26 @@ Database Browser
(require 'database-browse)
- - Procedure: browse DATABASE
+ - Procedure: browse database
Prints the names of all the tables in DATABASE and sets browse's
default to DATABASE.
- Procedure: browse
Prints the names of all the tables in the default database.
- - Procedure: browse TABLE-NAME
+ - Procedure: browse table-name
For each record of the table named by the symbol TABLE-NAME,
prints a line composed of all the field values.
- - Procedure: browse PATHNAME
+ - Procedure: browse pathname
Opens the database named by the string PATHNAME, prints the names
of all its tables, and sets browse's default to the database.
- - Procedure: browse DATABASE TABLE-NAME
+ - Procedure: browse database table-name
Sets browse's default to DATABASE and prints the records of the
table named by the symbol TABLE-NAME.
- - Procedure: browse PATHNAME TABLE-NAME
+ - Procedure: browse pathname table-name
Opens the database named by the string PATHNAME and sets browse's
default to it; `browse' prints the records of the table named by
the symbol TABLE-NAME.
@@ -6832,7 +7304,7 @@ other data structures for large aggregates:
* Operations to find and remove minimum element make weight balanced
trees simple to use for priority queues.
- * The implementation is *functional* rather than *imperative*. This
+ * The implementation is _functional_ rather than _imperative_. This
means that operations like `inserting' an association in a tree do
not destroy the old tree, in much the same way that `(+ 1 x)'
modifies neither the constant 1 nor the value bound to `x'. The
@@ -6840,13 +7312,14 @@ other data structures for large aggregates:
worry about copying the trees. Referential transparency allows
space efficiency to be achieved by sharing subtrees.
+
These features make weight-balanced trees suitable for a wide range of
applications, especially those that require large numbers of sets or
discrete maps. Applications that have a few global databases and/or
concentrate on element-level operations like insertion and lookup are
probably better off using hash-tables or red-black trees.
- The *size* of a tree is the number of associations that it contains.
+ The _size_ of a tree is the number of associations that it contains.
Weight balanced binary trees are balanced to keep the sizes of the
subtrees of each node within a constant factor of each other. This
ensures logarithmic times for single-path operations (like lookup and
@@ -6894,7 +7367,7 @@ Construction of Weight-Balanced Trees
Binary trees require there to be a total order on the keys used to
arrange the elements in the tree. Weight balanced trees are organized
-by *types*, where the type is an object encapsulating the ordering
+by _types_, where the type is an object encapsulating the ordering
relation. Creating a tree is a two-stage process. First a tree type
must be created from the predicate which gives the ordering. The tree
type is then used for making trees, either empty or singleton trees or
@@ -6904,7 +7377,7 @@ compatibility between trees in operations taking two trees. Usually a
small number of tree types are created at the beginning of a program and
used many times throughout the program's execution.
- - procedure+: make-wt-tree-type KEY<?
+ - procedure+: make-wt-tree-type key<?
This procedure creates and returns a new tree type based on the
ordering predicate KEY<?. KEY<? must be a total ordering, having
the property that for all key values `a', `b' and `c':
@@ -6936,21 +7409,21 @@ used many times throughout the program's execution.
(define string-wt-type (make-wt-tree-type string<?))
- - procedure+: make-wt-tree WT-TREE-TYPE
+ - procedure+: make-wt-tree wt-tree-type
This procedure creates and returns a newly allocated weight
balanced tree. The tree is empty, i.e. it contains no
associations. WT-TREE-TYPE is a weight balanced tree type
obtained by calling `make-wt-tree-type'; the returned tree has
this type.
- - procedure+: singleton-wt-tree WT-TREE-TYPE KEY DATUM
+ - procedure+: singleton-wt-tree wt-tree-type key datum
This procedure creates and returns a newly allocated weight
balanced tree. The tree contains a single association, that of
DATUM with KEY. WT-TREE-TYPE is a weight balanced tree type
obtained by calling `make-wt-tree-type'; the returned tree has
this type.
- - procedure+: alist->wt-tree TREE-TYPE ALIST
+ - procedure+: alist->wt-tree tree-type alist
Returns a newly allocated weight-balanced tree that contains the
same associations as ALIST. This procedure is equivalent to:
@@ -6974,19 +7447,19 @@ trees. These operations are the usual tree operations for insertion,
deletion and lookup, some predicates and a procedure for determining the
number of associations in a tree.
- - procedure+: wt-tree? OBJECT
+ - procedure+: wt-tree? object
Returns `#t' if OBJECT is a weight-balanced tree, otherwise
returns `#f'.
- - procedure+: wt-tree/empty? WT-TREE
+ - procedure+: wt-tree/empty? wt-tree
Returns `#t' if WT-TREE contains no associations, otherwise
returns `#f'.
- - procedure+: wt-tree/size WT-TREE
+ - procedure+: wt-tree/size wt-tree
Returns the number of associations in WT-TREE, an exact
non-negative integer. This operation takes constant time.
- - procedure+: wt-tree/add WT-TREE KEY DATUM
+ - procedure+: wt-tree/add wt-tree key datum
Returns a new tree containing all the associations in WT-TREE and
the association of DATUM with KEY. If WT-TREE already had an
association for KEY, the new association overrides the old. The
@@ -6994,34 +7467,34 @@ number of associations in a tree.
proportional to the logarithm of the number of associations in
WT-TREE.
- - procedure+: wt-tree/add! WT-TREE KEY DATUM
+ - procedure+: wt-tree/add! wt-tree key datum
Associates DATUM with KEY in WT-TREE and returns an unspecified
value. If WT-TREE already has an association for KEY, that
association is replaced. The average and worst-case times
required by this operation are proportional to the logarithm of
the number of associations in WT-TREE.
- - procedure+: wt-tree/member? KEY WT-TREE
+ - procedure+: wt-tree/member? key wt-tree
Returns `#t' if WT-TREE contains an association for KEY, otherwise
returns `#f'. The average and worst-case times required by this
operation are proportional to the logarithm of the number of
associations in WT-TREE.
- - procedure+: wt-tree/lookup WT-TREE KEY DEFAULT
+ - procedure+: wt-tree/lookup wt-tree key default
Returns the datum associated with KEY in WT-TREE. If WT-TREE
doesn't contain an association for KEY, DEFAULT is returned. The
average and worst-case times required by this operation are
proportional to the logarithm of the number of associations in
WT-TREE.
- - procedure+: wt-tree/delete WT-TREE KEY
+ - procedure+: wt-tree/delete wt-tree key
Returns a new tree containing all the associations in WT-TREE,
except that if WT-TREE contains an association for KEY, it is
removed from the result. The average and worst-case times required
by this operation are proportional to the logarithm of the number
of associations in WT-TREE.
- - procedure+: wt-tree/delete! WT-TREE KEY
+ - procedure+: wt-tree/delete! wt-tree key
If WT-TREE contains an association for KEY the association is
removed. Returns an unspecified value. The average and worst-case
times required by this operation are proportional to the logarithm
@@ -7033,25 +7506,25 @@ File: slib.info, Node: Advanced Operations on Weight-Balanced Trees, Next: Ind
Advanced Operations on Weight-Balanced Trees
--------------------------------------------
- In the following the *size* of a tree is the number of associations
-that the tree contains, and a *smaller* tree contains fewer
+ In the following the _size_ of a tree is the number of associations
+that the tree contains, and a _smaller_ tree contains fewer
associations.
- - procedure+: wt-tree/split< WT-TREE BOUND
+ - procedure+: wt-tree/split< wt-tree bound
Returns a new tree containing all and only the associations in
WT-TREE which have a key that is less than BOUND in the ordering
relation of the tree type of WT-TREE. The average and worst-case
times required by this operation are proportional to the logarithm
of the size of WT-TREE.
- - procedure+: wt-tree/split> WT-TREE BOUND
+ - procedure+: wt-tree/split> wt-tree bound
Returns a new tree containing all and only the associations in
WT-TREE which have a key that is greater than BOUND in the
ordering relation of the tree type of WT-TREE. The average and
worst-case times required by this operation are proportional to the
logarithm of size of WT-TREE.
- - procedure+: wt-tree/union WT-TREE-1 WT-TREE-2
+ - procedure+: wt-tree/union wt-tree-1 wt-tree-2
Returns a new tree containing all the associations from both trees.
This operation is asymmetric: when both trees have an association
for the same key, the returned tree associates the datum from
@@ -7064,7 +7537,7 @@ associations.
the other tree then the time required is at worst proportional to
the logarithm of the size of the larger tree.
- - procedure+: wt-tree/intersection WT-TREE-1 WT-TREE-2
+ - procedure+: wt-tree/intersection wt-tree-1 wt-tree-2
Returns a new tree containing all and only those associations from
WT-TREE-1 which have keys appearing as the key of an association
in WT-TREE-2. Thus the associated data in the result are those
@@ -7075,9 +7548,9 @@ associations.
this operation is never worse that proportional to the sum of the
sizes of the trees.
- - procedure+: wt-tree/difference WT-TREE-1 WT-TREE-2
+ - procedure+: wt-tree/difference wt-tree-1 wt-tree-2
Returns a new tree containing all and only those associations from
- WT-TREE-1 which have keys that *do not* appear as the key of an
+ WT-TREE-1 which have keys that _do not_ appear as the key of an
association in WT-TREE-2. If the trees are viewed as sets the
result is the asymmetric set difference of the arguments. As a
discrete map operation, it computes the domain restriction of
@@ -7085,7 +7558,7 @@ associations.
time required by this operation is never worse that proportional to
the sum of the sizes of the trees.
- - procedure+: wt-tree/subset? WT-TREE-1 WT-TREE-2
+ - procedure+: wt-tree/subset? wt-tree-1 wt-tree-2
Returns `#t' iff the key of each association in WT-TREE-1 is the
key of some association in WT-TREE-2, otherwise returns `#f'.
Viewed as a set operation, `wt-tree/subset?' is the improper subset
@@ -7100,9 +7573,9 @@ associations.
required by this operation is proportional to the size of
WT-TREE-1.
- - procedure+: wt-tree/set-equal? WT-TREE-1 WT-TREE-2
+ - procedure+: wt-tree/set-equal? wt-tree-1 wt-tree-2
Returns `#t' iff for every association in WT-TREE-1 there is an
- association in WT-TREE-2 that has the same key, and *vice versa*.
+ association in WT-TREE-2 that has the same key, and _vice versa_.
Viewing the arguments as sets `wt-tree/set-equal?' is the set
equality predicate. As a map operation it determines if two maps
@@ -7117,7 +7590,7 @@ associations.
In the worst-case the time required by this operation is
proportional to the size of the smaller tree.
- - procedure+: wt-tree/fold COMBINER INITIAL WT-TREE
+ - procedure+: wt-tree/fold combiner initial wt-tree
This procedure reduces WT-TREE by combining all the associations,
using an reverse in-order traversal, so the associations are
visited in reverse order. COMBINER is a procedure of three
@@ -7138,7 +7611,7 @@ associations.
0
WT-TREE)
- - procedure+: wt-tree/for-each ACTION WT-TREE
+ - procedure+: wt-tree/for-each action wt-tree
This procedure traverses the tree in-order, applying ACTION to
each association. The associations are processed in increasing
order of their keys. ACTION is a procedure of two arguments which
@@ -7162,9 +7635,9 @@ sequence of associations. Elements of the sequence can be accessed by
position, and the position of an element in the sequence can be
determined, both in logarthmic time.
- - procedure+: wt-tree/index WT-TREE INDEX
- - procedure+: wt-tree/index-datum WT-TREE INDEX
- - procedure+: wt-tree/index-pair WT-TREE INDEX
+ - procedure+: wt-tree/index wt-tree index
+ - procedure+: wt-tree/index-datum wt-tree index
+ - procedure+: wt-tree/index-pair wt-tree index
Returns the 0-based INDEXth association of WT-TREE in the sorted
sequence under the tree's ordering relation on the keys.
`wt-tree/index' returns the INDEXth key, `wt-tree/index-datum'
@@ -7187,7 +7660,7 @@ determined, both in logarthmic time.
maximum: (wt-tree/index WT-TREE
(-1+ (wt-tree/size WT-TREE)))
- - procedure+: wt-tree/rank WT-TREE KEY
+ - procedure+: wt-tree/rank wt-tree key
Determines the 0-based position of KEY in the sorted sequence of
the keys under the tree's ordering relation, or `#f' if the tree
has no association with for KEY. This procedure returns either an
@@ -7195,9 +7668,9 @@ determined, both in logarthmic time.
times required by this operation are proportional to the logarithm
of the number of associations in the tree.
- - procedure+: wt-tree/min WT-TREE
- - procedure+: wt-tree/min-datum WT-TREE
- - procedure+: wt-tree/min-pair WT-TREE
+ - procedure+: wt-tree/min wt-tree
+ - procedure+: wt-tree/min-datum wt-tree
+ - procedure+: wt-tree/min-pair wt-tree
Returns the association of WT-TREE that has the least key under
the tree's ordering relation. `wt-tree/min' returns the least key,
`wt-tree/min-datum' returns the datum associated with the least key
@@ -7212,7 +7685,7 @@ determined, both in logarthmic time.
(define (wt-tree/min-datum tree) (wt-tree/index-datum tree 0))
(define (wt-tree/min-pair tree) (wt-tree/index-pair tree 0))
- - procedure+: wt-tree/delete-min WT-TREE
+ - procedure+: wt-tree/delete-min wt-tree
Returns a new tree containing all of the associations in WT-TREE
except the association with the least key under the WT-TREE's
ordering relation. An error is signalled if the tree is empty.
@@ -7222,7 +7695,7 @@ determined, both in logarthmic time.
(wt-tree/delete WT-TREE (wt-tree/min WT-TREE))
- - procedure+: wt-tree/delete-min! WT-TREE
+ - procedure+: wt-tree/delete-min! wt-tree
Removes the association with the least key under the WT-TREE's
ordering relation. An error is signalled if the tree is empty.
The average and worst-case times required by this operation are
@@ -7240,14 +7713,15 @@ Other Packages
* Menu:
* Data Structures:: Various data structures.
+* Sorting and Searching:: |
* Procedures:: Miscellaneous utility procedures.
* Standards Support:: Support for Scheme Standards.
* Session Support:: REPL and Debugging.
* Extra-SLIB Packages::

-File: slib.info, Node: Data Structures, Next: Procedures, Prev: Other Packages, Up: Other Packages
-
+File: slib.info, Node: Data Structures, Next: Sorting and Searching, Prev: Other Packages, Up: Other Packages
+ |
Data Structures
===============
@@ -7257,6 +7731,7 @@ Data Structures
* Array Mapping:: 'array-for-each
* Association Lists:: 'alist
* Byte:: 'byte
+* Portable Image Files:: 'pnm
* Collections:: 'collect
* Dynamic Data Type:: 'dynamic
* Hash Tables:: 'hash-table
@@ -7264,8 +7739,7 @@ Data Structures
* Object:: 'object
* Priority Queues:: 'priority-queue
* Queues:: 'queue
-* Records:: 'record
-* Structures:: 'struct, 'structure
+* Records:: 'record |

File: slib.info, Node: Arrays, Next: Array Mapping, Prev: Data Structures, Up: Data Structures
@@ -7275,24 +7749,40 @@ Arrays
`(require 'array)'
- - Function: array? OBJ
+ - Function: array? obj
Returns `#t' if the OBJ is an array, and `#f' if not.
- - Function: make-array INITIAL-VALUE BOUND1 BOUND2 ...
- Creates and returns an array that has as many dimensins as there
- are BOUNDs and fills it with INITIAL-VALUE.
+_Note:_ Arrays are not disjoint from other Scheme types. Strings and |
+vectors also satisfy `array?'. A disjoint array predicate can be |
+written: |
+ |
+ (define (strict-array? obj) |
+ (and (array? obj) (not (string? obj)) (not (vector? obj)))) |
+ |
+ - Function: array=? array1 array2 |
+ Returns `#t' if ARRAY1 and ARRAY2 have the same rank and shape and |
+ the corresponding elements of ARRAY1 and ARRAY2 are `equal?'. |
+ |
+ (array=? (make-array 'foo 3 3) (make-array 'foo '(0 2) '(1 2))) |
+ => #t |
+ |
+ - Function: make-array initial-value bound1 bound2 ...
+ Creates and returns an array with dimensions BOUND1, BOUND2, ... |
+ and filled with INITIAL-VALUE. |
- When constructing an array, BOUND is either an inclusive range of
+When constructing an array, BOUND is either an inclusive range of
indices expressed as a two element list, or an upper bound expressed as
a single integer. So
+
(make-array 'foo 3 3) == (make-array 'foo '(0 2) '(0 2))
- - Function: make-shared-array ARRAY MAPPER BOUND1 BOUND2 ...
+ - Function: make-shared-array array mapper bound1 bound2 ...
`make-shared-array' can be used to create shared subarrays of other
arrays. The MAPPER is a function that translates coordinates in
the new array into coordinates in the old array. A MAPPER must be
linear, and its range must stay within the bounds of the old
array, but it can be otherwise arbitrary. A simple example:
+
(define fred (make-array #f 8 8))
(define freds-diagonal
(make-shared-array fred (lambda (i) (list i i)) 8))
@@ -7305,44 +7795,32 @@ a single integer. So
(array-ref freds-center 0 0)
=> FOO
- - Function: array-rank OBJ
+ - Function: array-rank obj
Returns the number of dimensions of OBJ. If OBJ is not an array,
0 is returned.
- - Function: array-shape ARRAY
- `array-shape' returns a list of inclusive bounds. So:
+ - Function: array-shape array
+ Returns a list of inclusive bounds. |
+ |
(array-shape (make-array 'foo 3 5))
=> ((0 2) (0 4))
- - Function: array-dimensions ARRAY
+ - Function: array-dimensions array
`array-dimensions' is similar to `array-shape' but replaces
- elements with a 0 minimum with one greater than the maximum. So:
+ elements with a 0 minimum with one greater than the maximum. |
+ |
(array-dimensions (make-array 'foo 3 5))
=> (3 5)
- - Procedure: array-in-bounds? ARRAY INDEX1 INDEX2 ...
+ - Function: array-in-bounds? array index1 index2 ... |
Returns `#t' if its arguments would be acceptable to `array-ref'.
- - Function: array-ref ARRAY INDEX1 INDEX2 ...
- Returns the element at the `(INDEX1, INDEX2)' element in ARRAY.
-
- - Procedure: array-set! ARRAY NEW-VALUE INDEX1 INDEX2 ...
-
- - Function: array-1d-ref ARRAY INDEX
- - Function: array-2d-ref ARRAY INDEX1 INDEX2
- - Function: array-3d-ref ARRAY INDEX1 INDEX2 INDEX3
+ - Function: array-ref array index1 index2 ...
+ Returns the (INDEX1, INDEX2, ...) element of ARRAY. |
- - Procedure: array-1d-set! ARRAY NEW-VALUE INDEX
- - Procedure: array-2d-set! ARRAY NEW-VALUE INDEX1 INDEX2
- - Procedure: array-3d-set! ARRAY NEW-VALUE INDEX1 INDEX2 INDEX3
-
- The functions are just fast versions of `array-ref' and `array-set!'
-that take a fixed number of arguments, and perform no bounds checking.
-
- If you comment out the bounds checking code, this is about as
-efficient as you could ask for without help from the compiler.
-
- An exercise left to the reader: implement the rest of APL.
+ - Function: array-set! array obj index1 index2 ... |
+ Stores OBJ in the (INDEX1, INDEX2, ...) element of ARRAY. The |
+ value returned by `array-set!' is unspecified. |

File: slib.info, Node: Array Mapping, Next: Association Lists, Prev: Arrays, Up: Data Structures
@@ -7352,7 +7830,7 @@ Array Mapping
`(require 'array-for-each)'
- - Function: array-map! ARRAY0 PROC ARRAY1 ...
+ - Function: array-map! array0 proc array1 ...
ARRAY1, ... must have the same number of dimensions as ARRAY0 and
have a range for each index which includes the range for the
corresponding index in ARRAY0. PROC is applied to each tuple of
@@ -7369,7 +7847,7 @@ Array Mapping
a list of indexes for which ARRAY is defined, (equal? LI (apply
array-ref (array-indexes ARRAY) LI)).
- - Function: array-index-map! ARRAY PROC
+ - Function: array-index-map! array proc
applies PROC to the indices of each element of ARRAY in turn,
storing the result in the corresponding element. The value
returned and the order of application are unspecified.
@@ -7385,7 +7863,7 @@ Array Mapping
(array-index-map! v (lambda (i) i))
v))
- - Function: array-copy! SOURCE DESTINATION
+ - Function: array-copy! source destination
Copies every element from vector or array SOURCE to the
corresponding element of DESTINATION. DESTINATION must have the
same rank as SOURCE, and be at least as large in each dimension.
@@ -7407,18 +7885,18 @@ symmetric, and transitive.
Alist functions can be used with a secondary index method such as hash
tables for improved performance.
- - Function: predicate->asso PRED
+ - Function: predicate->asso pred
Returns an "association function" (like `assq', `assv', or
`assoc') corresponding to PRED. The returned function returns a
key-value pair whose key is `pred'-equal to its first argument or
`#f' if no key in the alist is PRED-equal to the first argument.
- - Function: alist-inquirer PRED
+ - Function: alist-inquirer pred
Returns a procedure of 2 arguments, ALIST and KEY, which returns
the value associated with KEY in ALIST or `#f' if KEY does not
appear in ALIST.
- - Function: alist-associator PRED
+ - Function: alist-associator pred
Returns a procedure of 3 arguments, ALIST, KEY, and VALUE, which
returns an alist with KEY and VALUE associated. Any previous
value associated with KEY will be lost. This returned procedure
@@ -7428,7 +7906,7 @@ tables for improved performance.
(define alist '())
(set! alist (put alist "Foo" 9))
- - Function: alist-remover PRED
+ - Function: alist-remover pred
Returns a procedure of 2 arguments, ALIST and KEY, which returns
an alist with an association whose KEY is key removed. This
returned procedure may or may not have side effects on its ALIST
@@ -7436,17 +7914,17 @@ tables for improved performance.
(define rem (alist-remover string-ci=?))
(set! alist (rem alist "foo"))
- - Function: alist-map PROC ALIST
+ - Function: alist-map proc alist
Returns a new association list formed by mapping PROC over the
keys and values of ALIST. PROC must be a function of 2 arguments
which returns the new value part.
- - Function: alist-for-each PROC ALIST
+ - Function: alist-for-each proc alist
Applies PROC to each pair of keys and values of ALIST. PROC must
be a function of 2 arguments. The returned value is unspecified.

-File: slib.info, Node: Byte, Next: Collections, Prev: Association Lists, Up: Data Structures
+File: slib.info, Node: Byte, Next: Portable Image Files, Prev: Association Lists, Up: Data Structures
Byte
----
@@ -7458,28 +7936,28 @@ Using Scheme strings to implement these arrays is not portable vis-a-vis
the correspondence between integers and characters and non-ascii
character sets. These functions abstract the notion of a "byte".
- - Function: byte-ref BYTES K
+ - Function: byte-ref bytes k
K must be a valid index of BYTES. `byte-ref' returns byte K of
BYTES using zero-origin indexing.
- - Procedure: byte-set! BYTES K BYTE
+ - Procedure: byte-set! bytes k byte
K must be a valid index of BYTES%, and BYTE must be a small
integer. `Byte-set!' stores BYTE in element K of BYTES and
returns an unspecified value.
- - Function: make-bytes K
- - Function: make-bytes K BYTE
+ - Function: make-bytes k
+ - Function: make-bytes k byte
`Make-bytes' returns a newly allocated byte-array of length K. If
BYTE is given, then all elements of the byte-array are initialized
to BYTE, otherwise the contents of the byte-array are unspecified.
- - Function: bytes-length BYTES
+ - Function: bytes-length bytes
`bytes-length' returns length of byte-array BYTES.
- - Function: write-byte BYTE
- - Function: write-byte BYTE PORT
+ - Function: write-byte byte
+ - Function: write-byte byte port
Writes the byte BYTE (not an external representation of the byte)
to the given PORT and returns an unspecified value. The PORT
argument may be omitted, in which case it defaults to the value
@@ -7487,7 +7965,7 @@ character sets. These functions abstract the notion of a "byte".
- Function: read-byte
- - Function: read-byte PORT
+ - Function: read-byte port
Returns the next byte available from the input PORT, updating the
PORT to point to the following byte. If no more bytes are
available, an end of file object is returned. PORT may be
@@ -7495,12 +7973,12 @@ character sets. These functions abstract the notion of a "byte".
`current-input-port'.
- - Function: bytes BYTE ...
+ - Function: bytes byte ...
Returns a newly allocated byte-array composed of the arguments.
- - Function: bytes->list BYTES
- - Function: list->bytes BYTES
+ - Function: bytes->list bytes
+ - Function: list->bytes bytes
`Bytes->list' returns a newly allocated list of the bytes that
make up the given byte-array. `List->bytes' returns a newly
allocated byte-array formed from the small integers in the list
@@ -7509,7 +7987,58 @@ character sets. These functions abstract the notion of a "byte".

-File: slib.info, Node: Collections, Next: Dynamic Data Type, Prev: Byte, Up: Data Structures
+File: slib.info, Node: Portable Image Files, Next: Collections, Prev: Byte, Up: Data Structures
+
+Portable Image Files
+--------------------
+
+ `(require 'pnm)'
+
+ - Function: pnm:type-dimensions path
+ The string PATH must name a "portable bitmap graphics" file.
+ `pnm:type-dimensions' returns a list of 4 items:
+ 1. A symbol describing the type of the file named by PATH.
+
+ 2. The image width in pixels.
+
+ 3. The image height in pixels.
+
+ 4. The maximum value of pixels assume in the file.
+
+ The current set of file-type symbols is:
+ pbm
+ pbm-raw
+ Black-and-White image; pixel values are 0 or 1.
+
+ pgm
+ pgm-raw
+ Gray (monochrome) image; pixel values are from 0 to MAXVAL
+ specified in file header.
+
+ ppm
+ ppm-raw
+ RGB (full color) image; red, green, and blue interleaved
+ pixel values are from 0 to MAXVAL
+
+
+ - Function: pnm:image-file->array path array
+ Reads the "portable bitmap graphics" file named by PATH into
+ ARRAY. ARRAY must be the correct size and type for PATH. ARRAY
+ is returned.
+
+ - Function: pnm:image-file->array path
+ `pnm:image-file->array' creates and returns an array with the
+ "portable bitmap graphics" file named by PATH read into it.
+
+
+ - Procedure: pnm:array-write type array maxval path
+ Writes the contents of ARRAY to a TYPE image file named PATH. The
+ file will have pixel values between 0 and MAXVAL, which must be
+ compatible with TYPE. For `pbm' files, MAXVAL must be `1'.
+
+
+
+File: slib.info, Node: Collections, Next: Dynamic Data Type, Prev: Portable Image Files, Up: Data Structures
Collections
-----------
@@ -7523,7 +8052,7 @@ Dylan(TM) language, but with a different interface. They have
implicit (as with lists).
New types of collections may be defined as YASOS objects (*note
-Yasos::.). They must support the following operations:
+Yasos::). They must support the following operations:
* `(collection? SELF)' (always returns `#t');
* `(size SELF)' returns the number of elements in the collection;
@@ -7542,12 +8071,12 @@ Yasos::.). They must support the following operations:
They might support specialized `for-each-key' and `for-each-elt'
operations.
- - Function: collection? OBJ
+ - Function: collection? obj
A predicate, true initially of lists, vectors and strings. New
sorts of collections must answer `#t' to `collection?'.
- - Procedure: map-elts PROC . COLLECTIONS
- - Procedure: do-elts PROC . COLLECTIONS
+ - Procedure: map-elts proc collection1 ... |
+ - Procedure: do-elts proc collection1 ... |
PROC is a procedure taking as many arguments as there are
COLLECTIONS (at least one). The COLLECTIONS are iterated over in
their natural order and PROC is applied to the elements yielded by
@@ -7562,26 +8091,26 @@ operations.
(map-elts + (list 1 2 3) (vector 1 2 3))
=> #(2 4 6)
- - Procedure: map-keys PROC . COLLECTIONS
- - Procedure: do-keys PROC . COLLECTIONS
+ - Procedure: map-keys proc collection1 ... |
+ - Procedure: do-keys proc collection1 ... |
These are analogous to `map-elts' and `do-elts', but each
- iteration is over the COLLECTIONS' *keys* rather than their
+ iteration is over the COLLECTIONS' _keys_ rather than their
elements.
Example:
(map-keys + (list 1 2 3) (vector 1 2 3))
=> #(0 2 4)
- - Procedure: for-each-key COLLECTION PROC
- - Procedure: for-each-elt COLLECTION PROC
+ - Procedure: for-each-key collection proc
+ - Procedure: for-each-elt collection proc
These are like `do-keys' and `do-elts' but only for a single
collection; they are potentially more efficient.
- - Function: reduce PROC SEED . COLLECTIONS
+ - Function: reduce proc seed collection1 ... |
A generalization of the list-based `comlist:reduce-init' (*note
- Lists as sequences::.) to collections which will shadow the
+ Lists as sequences::) to collections which will shadow the
list-based version if `(require 'collect)' follows `(require
- 'common-list-functions)' (*note Common List Functions::.).
+ 'common-list-functions)' (*note Common List Functions::).
Examples:
(reduce + 0 (vector 1 2 3))
@@ -7589,31 +8118,31 @@ operations.
(reduce union '() '((a b c) (b c d) (d a)))
=> (c b d a).
- - Function: any? PRED . COLLECTIONS
+ - Function: any? pred collection1 ... |
A generalization of the list-based `some' (*note Lists as
- sequences::.) to collections.
+ sequences::) to collections.
Example:
(any? odd? (list 2 3 4 5))
=> #t
- - Function: every? PRED . COLLECTIONS
+ - Function: every? pred collection1 ... |
A generalization of the list-based `every' (*note Lists as
- sequences::.) to collections.
+ sequences::) to collections.
Example:
(every? collection? '((1 2) #(1 2)))
=> #t
- - Function: empty? COLLECTION
+ - Function: empty? collection
Returns `#t' iff there are no elements in COLLECTION.
`(empty? COLLECTION) == (zero? (size COLLECTION))'
- - Function: size COLLECTION
+ - Function: size collection
Returns the number of elements in COLLECTION.
- - Function: Setter LIST-REF
+ - Function: Setter list-ref
See *Note Setters:: for a definition of "setter". N.B. `(setter
list-ref)' doesn't work properly for element 0 of a list.
@@ -7685,23 +8214,23 @@ Dynamic Data Type
`(require 'dynamic)'
- - Function: make-dynamic OBJ
+ - Function: make-dynamic obj
Create and returns a new "dynamic" whose global value is OBJ.
- - Function: dynamic? OBJ
+ - Function: dynamic? obj
Returns true if and only if OBJ is a dynamic. No object
satisfying `dynamic?' satisfies any of the other standard type
predicates.
- - Function: dynamic-ref DYN
+ - Function: dynamic-ref dyn
Return the value of the given dynamic in the current dynamic
environment.
- - Procedure: dynamic-set! DYN OBJ
+ - Procedure: dynamic-set! dyn obj
Change the value of the given dynamic to OBJ in the current
dynamic environment. The returned value is unspecified.
- - Function: call-with-dynamic-binding DYN OBJ THUNK
+ - Function: call-with-dynamic-binding dyn obj thunk
Invoke and return the value of the given thunk in a new, nested
dynamic environment in which the given dynamic has been bound to a
new location whose initial contents are the value OBJ. This
@@ -7720,7 +8249,7 @@ Hash Tables
`(require 'hash-table)'
- - Function: predicate->hash PRED
+ - Function: predicate->hash pred
Returns a hash function (like `hashq', `hashv', or `hash')
corresponding to the equality predicate PRED. PRED should be
`eq?', `eqv?', `equal?', `=', `char=?', `char-ci=?', `string=?', or
@@ -7728,7 +8257,7 @@ Hash Tables
A hash table is a vector of association lists.
- - Function: make-hash-table K
+ - Function: make-hash-table k
Returns a vector of K empty (association) lists.
Hash table functions provide utilities for an associative database.
@@ -7736,33 +8265,33 @@ These functions take an equality predicate, PRED, as an argument. PRED
should be `eq?', `eqv?', `equal?', `=', `char=?', `char-ci=?',
`string=?', or `string-ci=?'.
- - Function: predicate->hash-asso PRED
+ - Function: predicate->hash-asso pred
Returns a hash association function of 2 arguments, KEY and
HASHTAB, corresponding to PRED. The returned function returns a
key-value pair whose key is PRED-equal to its first argument or
`#f' if no key in HASHTAB is PRED-equal to the first argument.
- - Function: hash-inquirer PRED
- Returns a procedure of 3 arguments, `hashtab' and `key', which
- returns the value associated with `key' in `hashtab' or `#f' if
- key does not appear in `hashtab'.
+ - Function: hash-inquirer pred
+ Returns a procedure of 2 arguments, HASHTAB and KEY, which returns |
+ the value associated with KEY in HASHTAB or `#f' if KEY does not |
+ appear in HASHTAB. |
- - Function: hash-associator PRED
+ - Function: hash-associator pred
Returns a procedure of 3 arguments, HASHTAB, KEY, and VALUE, which
modifies HASHTAB so that KEY and VALUE associated. Any previous
value associated with KEY will be lost.
- - Function: hash-remover PRED
+ - Function: hash-remover pred
Returns a procedure of 2 arguments, HASHTAB and KEY, which
modifies HASHTAB so that the association whose key is KEY is
removed.
- - Function: hash-map PROC HASH-TABLE
+ - Function: hash-map proc hash-table
Returns a new hash table formed by mapping PROC over the keys and
values of HASH-TABLE. PROC must be a function of 2 arguments
which returns the new value part.
- - Function: hash-for-each PROC HASH-TABLE
+ - Function: hash-for-each proc hash-table
Applies PROC to each pair of keys and values of HASH-TABLE. PROC
must be a function of 2 arguments. The returned value is
unspecified.
@@ -7778,9 +8307,9 @@ Hashing
These hashing functions are for use in quickly classifying objects.
Hash tables use these functions.
- - Function: hashq OBJ K
- - Function: hashv OBJ K
- - Function: hash OBJ K
+ - Function: hashq obj k
+ - Function: hashv obj k
+ - Function: hash obj k
Returns an exact non-negative integer less than K. For each
non-negative integer less than K there are arguments OBJ for which
the hashing functions applied to OBJ and K returns that integer.
@@ -7800,9 +8329,9 @@ Hash tables use these functions.
`(require 'sierpinski)'
- - Function: make-sierpinski-indexer MAX-COORDINATE
+ - Function: make-sierpinski-indexer max-coordinate
Returns a procedure (eg hash-function) of 2 numeric arguments which
- preserves *nearness* in its mapping from NxN to N.
+ preserves _nearness_ in its mapping from NxN to N.
MAX-COORDINATE is the maximum coordinate (a positive integer) of a
population of points. The returned procedures is a function that
@@ -7823,11 +8352,11 @@ Hash tables use these functions.
therefore, because the Sierpinski spacefilling curve is
continuous, we know they must also be near in the plane. Nearness
in the plane does not, however, necessarily correspond to nearness
- in index, although it *tends* to be so.
+ in index, although it _tends_ to be so.
Example applications:
* Sort points by Sierpinski index to get heuristic solution to
- *travelling salesman problem*. For details of performance,
+ _travelling salesman problem_. For details of performance,
see L. Platzman and J. Bartholdi, "Spacefilling curves and the
Euclidean travelling salesman problem", JACM 36(4):719-737
(October 1989) and references therein.
@@ -7846,15 +8375,15 @@ Hash tables use these functions.
`(require 'soundex)'
- - Function: soundex NAME
- Computes the *soundex* hash of NAME. Returns a string of an
+ - Function: soundex name
+ Computes the _soundex_ hash of NAME. Returns a string of an
initial letter and up to three digits between 0 and 6. Soundex
supposedly has the property that names that sound similar in normal
English pronunciation tend to map to the same key.
Soundex was a classic algorithm used for manual filing of personal
records before the advent of computers. It performs adequately for
- English names but has trouble with other nationalities.
+ English names but has trouble with other languages.
See Knuth, Vol. 3 `Sorting and searching', pp 391-2
@@ -7927,7 +8456,7 @@ PREDICATE
Procedures
----------
- - Function: make-object ANCESTOR ...
+ - Function: make-object ancestor ...
Returns an object. Current object implementation is a tagged
vector. ANCESTORs are optional and must be objects in terms of
object?. ANCESTORs methods are included in the object. Multiple
@@ -7935,10 +8464,10 @@ Procedures
In this case the method of the ANCESTOR first appearing in the
list is the one returned by `get-method'.
- - Function: object? OBJ
+ - Function: object? obj
Returns boolean value whether OBJ was created by make-object.
- - Function: make-generic-method EXCEPTION-PROCEDURE
+ - Function: make-generic-method exception-procedure
Returns a procedure which be associated with an object's methods.
If EXCEPTION-PROCEDURE is specified then it is used to process
non-objects.
@@ -7946,20 +8475,20 @@ Procedures
- Function: make-generic-predicate
Returns a boolean procedure for any scheme object.
- - Function: make-method! OBJECT GENERIC-METHOD METHOD
+ - Function: make-method! object generic-method method
Associates METHOD to the GENERIC-METHOD in the object. The METHOD
overrides any previous association with the GENERIC-METHOD within
- the object. Using `unmake-method!' will restore the object's
+ the object. Using `unmake-method!' will restore the object's
previous association with the GENERIC-METHOD. METHOD must be a
procedure.
- - Function: make-predicate! OBJECT GENERIC-PRECIATE
+ - Function: make-predicate! object generic-preciate
Makes a predicate method associated with the GENERIC-PREDICATE.
- - Function: unmake-method! OBJECT GENERIC-METHOD
+ - Function: unmake-method! object generic-method
Removes an object's association with a GENERIC-METHOD .
- - Function: get-method OBJECT GENERIC-METHOD
+ - Function: get-method object generic-method
Returns the object's method associated (if any) with the
GENERIC-METHOD. If no associated method exists an error is
flagged.
@@ -8116,18 +8645,18 @@ Priority Queues
`(require 'priority-queue)'
- - Function: make-heap PRED<?
+ - Function: make-heap pred<?
Returns a binary heap suitable which can be used for priority queue
operations.
- - Function: heap-length HEAP
+ - Function: heap-length heap
Returns the number of elements in HEAP.
- - Procedure: heap-insert! HEAP ITEM
+ - Procedure: heap-insert! heap item
Inserts ITEM into HEAP. ITEM can be inserted multiple times. The
value returned is unspecified.
- - Function: heap-extract-max! HEAP
+ - Function: heap-extract-max! heap
Returns the item which is larger than all others according to the
PRED<? argument to `make-heap'. If there are no items in HEAP, an
error is signaled.
@@ -8150,35 +8679,35 @@ rear, and removed from the front (i.e., they are what are often called
- Function: make-queue
Returns a new, empty queue.
- - Function: queue? OBJ
+ - Function: queue? obj
Returns `#t' if OBJ is a queue.
- - Function: queue-empty? Q
+ - Function: queue-empty? q
Returns `#t' if the queue Q is empty.
- - Procedure: queue-push! Q DATUM
+ - Procedure: queue-push! q datum
Adds DATUM to the front of queue Q.
- - Procedure: enquque! Q DATUM
+ - Procedure: enquque! q datum
Adds DATUM to the rear of queue Q.
All of the following functions raise an error if the queue Q is empty.
- - Function: queue-front Q
+ - Function: queue-front q
Returns the datum at the front of the queue Q.
- - Function: queue-rear Q
+ - Function: queue-rear q
Returns the datum at the rear of the queue Q.
- - Prcoedure: queue-pop! Q
- - Procedure: dequeue! Q
+ - Prcoedure: queue-pop! q
+ - Procedure: dequeue! q
Both of these procedures remove and return the datum at the front
of the queue. `queue-pop!' is used to suggest that the queue is
being used like a stack.

-File: slib.info, Node: Records, Next: Structures, Prev: Queues, Up: Data Structures
-
+File: slib.info, Node: Records, Prev: Queues, Up: Data Structures
+ |
Records
-------
@@ -8187,7 +8716,7 @@ Records
The Record package provides a facility for user to define their own
record data types.
- - Function: make-record-type TYPE-NAME FIELD-NAMES
+ - Function: make-record-type type-name field-names
Returns a "record-type descriptor", a value representing a new data
type disjoint from all others. The TYPE-NAME argument must be a
string, but is only used for debugging purposes (such as the
@@ -8197,7 +8726,7 @@ record data types.
duplicates. It is unspecified how record-type descriptors are
represented.
- - Function: record-constructor RTD [FIELD-NAMES]
+ - Function: record-constructor rtd [field-names]
Returns a procedure for constructing new members of the type
represented by RTD. The returned procedure accepts exactly as
many arguments as there are symbols in the given list,
@@ -8210,13 +8739,13 @@ record data types.
it is an error if it contains any duplicates or any symbols not in
the default list.
- - Function: record-predicate RTD
+ - Function: record-predicate rtd
Returns a procedure for testing membership in the type represented
by RTD. The returned procedure accepts exactly one argument and
returns a true value if the argument is a member of the indicated
record type; it returns a false value otherwise.
- - Function: record-accessor RTD FIELD-NAME
+ - Function: record-accessor rtd field-name
Returns a procedure for reading the value of a particular field of
a member of the type represented by RTD. The returned procedure
accepts exactly one argument which must be a record of the
@@ -8225,7 +8754,7 @@ record data types.
must be a member of the list of field-names in the call to
`make-record-type' that created the type represented by RTD.
- - Function: record-modifier RTD FIELD-NAME
+ - Function: record-modifier rtd field-name
Returns a procedure for writing the value of a particular field of
a member of the type represented by RTD. The returned procedure
accepts exactly two arguments: first, a record of the appropriate
@@ -8249,81 +8778,24 @@ types which are unforgeable and incorruptible by R4RS procedures.
supported.

-File: slib.info, Node: Structures, Prev: Records, Up: Data Structures
-
-Structures
-----------
-
- `(require 'struct)' (uses defmacros)
-
- `defmacro's which implement "records" from the book `Essentials of
-Programming Languages' by Daniel P. Friedman, M. Wand and C.T. Haynes.
-Copyright 1992 Jeff Alexander, Shinnder Lee, and Lewis Patterson
-
- Matthew McDonald <mafm@cs.uwa.edu.au> added field setters.
-
- - Macro: define-record TAG (VAR1 VAR2 ...)
- Defines several functions pertaining to record-name TAG:
-
- - Function: make-TAG VAR1 VAR2 ...
-
- - Function: TAG? OBJ
-
- - Function: TAG->VAR1 OBJ
-
- - Function: TAG->VAR2 OBJ
- ...
-
- - Function: set-TAG-VAR1! OBJ VAL
-
- - Function: set-TAG-VAR2! OBJ VAL
- ...
-
- Here is an example of its use.
-
- (define-record term (operator left right))
- => #<unspecified>
- (define foo (make-term 'plus 1 2))
- => foo
- (term->left foo)
- => 1
- (set-term-left! foo 2345)
- => #<unspecified>
- (term->left foo)
- => 2345
-
- - Macro: variant-case EXP (TAG (VAR1 VAR2 ...) BODY) ...
- executes the following for the matching clause:
-
- ((lambda (VAR1 VAR ...) BODY)
- (TAG->VAR1 EXP)
- (TAG->VAR2 EXP) ...)
-
-
-File: slib.info, Node: Procedures, Next: Standards Support, Prev: Data Structures, Up: Other Packages
-
-Procedures
-==========
-
- Anything that doesn't fall neatly into any of the other categories
-winds up here.
+File: slib.info, Node: Sorting and Searching, Next: Procedures, Prev: Data Structures, Up: Other Packages
+ |
+Sorting and Searching |
+===================== |
* Menu:
* Common List Functions:: 'common-list-functions
-* Tree Operations:: 'tree
+* Tree Operations:: 'tree |
* Chapter Ordering:: 'chapter-order
* Sorting:: 'sort
-* Topological Sort:: Keep your socks on.
-* String-Case:: 'string-case
-* String Ports:: 'string-port
+* Topological Sort:: Keep your socks on. |
* String Search:: Also Search from a Port.
-* Line I/O:: 'line-i/o
-* Multi-Processing:: 'process
+* Sequence Comparison:: 'diff and longest-common-subsequence |

-File: slib.info, Node: Common List Functions, Next: Tree Operations, Prev: Procedures, Up: Procedures
-
+File: slib.info, Node: Common List Functions, Next: Tree Operations, Prev: Sorting and Searching, Up: Sorting and Searching
+ |
Common List Functions
---------------------
@@ -8346,7 +8818,8 @@ File: slib.info, Node: List construction, Next: Lists as sets, Prev: Common L
List construction
.................
- - Function: make-list K . INIT
+ - Function: make-list k |
+ - Function: make-list k init |
`make-list' creates and returns a list of K elements. If INIT is
included, all elements in the list are initialized to INIT.
@@ -8356,7 +8829,7 @@ List construction
(make-list 5 'foo)
=> (foo foo foo foo foo)
- - Function: list* X . Y
+ - Function: list* obj1 obj2 ... |
Works like `list' except that the cdr of the last pair is the last
argument unless there is only one argument, when the result is
just that argument. Sometimes called `cons*'. E.g.:
@@ -8369,7 +8842,7 @@ List construction
(list* ARGS '())
== (list ARGS)
- - Function: copy-list LST
+ - Function: copy-list lst
`copy-list' makes a copy of LST using new pairs and returns it.
Only the top level of the list is copied, i.e., pairs forming
elements of the copied list remain `eq?' to the corresponding
@@ -8401,7 +8874,7 @@ Lists as sets
`eqv?' is used to test for membership by procedures which treat lists
as sets.
- - Function: adjoin E L
+ - Function: adjoin e l
`adjoin' returns the adjoint of the element E and the list L.
That is, if E is in L, `adjoin' returns L, otherwise, it returns
`(cons E L)'.
@@ -8412,37 +8885,36 @@ as sets.
(adjoin 'foo '(bar baz bang))
=> (foo bar baz bang)
- - Function: union L1 L2
+ - Function: union l1 l2
`union' returns the combination of L1 and L2. Duplicates between
L1 and L2 are culled. Duplicates within L1 or within L2 may or
may not be removed.
Example:
(union '(1 2 3 4) '(5 6 7 8))
- => (4 3 2 1 5 6 7 8)
+ => (8 7 6 5 1 2 3 4) |
(union '(1 2 3 4) '(3 4 5 6))
- => (2 1 3 4 5 6)
+ => (6 5 1 2 3 4) |
- - Function: intersection L1 L2
+ - Function: intersection l1 l2
`intersection' returns all elements that are in both L1 and L2.
Example:
(intersection '(1 2 3 4) '(3 4 5 6))
- => (3 4)
+ => (3 4) |
(intersection '(1 2 3 4) '(5 6 7 8))
=> ()
- - Function: set-difference L1 L2
- `set-difference' returns the union of all elements that are in L1
- but not in L2.
+ - Function: set-difference l1 l2
+ `set-difference' returns all elements that are in L1 but not in L2.
Example:
(set-difference '(1 2 3 4) '(3 4 5 6))
- => (1 2)
+ => (1 2) |
(set-difference '(1 2 3 4) '(1 2 3 4 5 6))
=> ()
- - Function: member-if PRED LST
+ - Function: member-if pred lst
`member-if' returns LST if `(PRED ELEMENT)' is `#t' for any
ELEMENT in LST. Returns `#f' if PRED does not apply to any
ELEMENT in LST.
@@ -8453,7 +8925,7 @@ as sets.
(member-if number? '(1 2 3 4))
=> (1 2 3 4)
- - Function: some PRED LST . MORE-LSTS
+ - Function: some pred lst1 lst2 ... |
PRED is a boolean function of as many arguments as there are list
arguments to `some' i.e., LST plus any optional arguments. PRED
is applied to successive elements of the list arguments in order.
@@ -8471,7 +8943,7 @@ as sets.
(some > '(2 3) '(1 4))
=> #f
- - Function: every PRED LST . MORE-LSTS
+ - Function: every pred lst1 lst2 ... |
`every' is analogous to `some' except it returns `#t' if every
application of PRED is `#t' and `#f' otherwise.
@@ -8485,11 +8957,11 @@ as sets.
(every > '(2 3) '(1 4))
=> #f
- - Function: notany PRED . LST
+ - Function: notany pred lst1 ... |
`notany' is analogous to `some' but returns `#t' if no application
of PRED returns `#t' or `#f' as soon as any one does.
- - Function: notevery PRED . LST
+ - Function: notevery pred lst1 ... |
`notevery' is analogous to `some' but returns `#t' as soon as an
application of PRED returns `#f', and `#f' otherwise.
@@ -8500,7 +8972,25 @@ as sets.
(notevery even? '(2 4 6 8))
=> #f
- - Function: find-if PRED LST
+ - Function: list-of?? predicate
+ Returns a predicate which returns true if its argument is a list
+ every element of which satisfies PREDICATE.
+
+ - Function: list-of?? predicate low-bound high-bound
+ LOW-BOUND and HIGH-BOUND are non-negative integers. `list-of??'
+ returns a predicate which returns true if its argument is a list
+ of length between LOW-BOUND and HIGH-BOUND (inclusive); every
+ element of which satisfies PREDICATE.
+
+ - Function: list-of?? predicate bound
+ BOUND is an integer. If BOUND is negative, `list-of??' returns a
+ predicate which returns true if its argument is a list of length
+ greater than `(- BOUND)'; every element of which satisfies
+ PREDICATE. Otherwise, `list-of??' returns a predicate which
+ returns true if its argument is a list of length less than or
+ equal to BOUND; every element of which satisfies PREDICATE.
+
+ - Function: find-if pred lst
`find-if' searches for the first ELEMENT in LST such that `(PRED
ELEMENT)' returns `#t'. If it finds any such ELEMENT in LST,
ELEMENT is returned. Otherwise, `#f' is returned.
@@ -8515,7 +9005,7 @@ as sets.
(find-if symbol? '(1 2 foo bar))
=> foo
- - Function: remove ELT LST
+ - Function: remove elt lst
`remove' removes all occurrences of ELT from LST using `eqv?' to
test for equality and returns everything that's left. N.B.: other
implementations (Chez, Scheme->C and T, at least) use `equal?' as
@@ -8523,12 +9013,12 @@ as sets.
Example:
(remove 1 '(1 2 1 3 1 4 1 5))
- => (2 3 4 5)
+ => (2 3 4 5) |
(remove 'foo '(bar baz bang))
- => (bar baz bang)
+ => (bar baz bang) |
- - Function: remove-if PRED LST
+ - Function: remove-if pred lst
`remove-if' removes all ELEMENTs from LST where `(PRED ELEMENT)'
is `#t' and returns everything that's left.
@@ -8537,9 +9027,9 @@ as sets.
=> ()
(remove-if even? '(1 2 3 4 5 6 7 8))
- => (1 3 5 7)
+ => (1 3 5 7) |
- - Function: remove-if-not PRED LST
+ - Function: remove-if-not pred lst
`remove-if-not' removes all ELEMENTs from LST for which `(PRED
ELEMENT)' is `#f' and returns everything that's left.
@@ -8547,9 +9037,9 @@ as sets.
(remove-if-not number? '(foo bar baz))
=> ()
(remove-if-not odd? '(1 2 3 4 5 6 7 8))
- => (1 3 5 7)
+ => (1 3 5 7) |
- - Function: has-duplicates? LST
+ - Function: has-duplicates? lst
returns `#t' if 2 members of LST are `equal?', `#f' otherwise.
Example:
@@ -8561,16 +9051,16 @@ as sets.
The procedure `remove-duplicates' uses `member' (rather than `memv').
- - Function: remove-duplicates LST
+ - Function: remove-duplicates lst
returns a copy of LST with its duplicate members removed.
Elements are considered duplicate if they are `equal?'.
Example:
(remove-duplicates '(1 2 3 4))
- => (4 3 2 1)
+ => (1 2 3 4) |
(remove-duplicates '(2 4 3 4))
- => (3 4 2)
+ => (2 4 3) |

File: slib.info, Node: Lists as sequences, Next: Destructive list operations, Prev: Lists as sets, Up: Common List Functions
@@ -8578,7 +9068,7 @@ File: slib.info, Node: Lists as sequences, Next: Destructive list operations,
Lists as sequences
..................
- - Function: position OBJ LST
+ - Function: position obj lst
`position' returns the 0-based position of OBJ in LST, or `#f' if
OBJ does not occur in LST.
@@ -8590,13 +9080,13 @@ Lists as sequences
(position 'oops '(foo bar baz bang))
=> #f
- - Function: reduce P LST
+ - Function: reduce p lst
`reduce' combines all the elements of a sequence using a binary
operation (the combination is left-associative). For example,
using `+', one can add up all the elements. `reduce' allows you to
apply a function which accepts only two arguments to more than 2
objects. Functional programmers usually refer to this as "foldl".
- `collect:reduce' (*note Collections::.) provides a version of
+ `collect:reduce' (*note Collections::) provides a version of
`collect' generalized to collections.
Example:
@@ -8621,7 +9111,7 @@ Lists as sequences
What follows is a rather non-standard implementation of `reverse'
in terms of `reduce' and a combinator elsewhere called "C".
- ;;; Contributed by Jussi Piitulainen (jpiitula@ling.helsinki.fi)
+ ;;; Contributed by Jussi Piitulainen (jpiitula @ ling.helsinki.fi)
(define commute
(lambda (f)
@@ -8632,7 +9122,7 @@ Lists as sequences
(lambda (args)
(reduce-init (commute cons) '() args)))
- - Function: reduce-init P INIT LST
+ - Function: reduce-init p init lst
`reduce-init' is the same as reduce, except that it implicitly
inserts INIT at the start of the list. `reduce-init' is preferred
if you want to handle the null list, the one-element, and lists
@@ -8682,7 +9172,7 @@ Lists as sequences
== (insert (1 1 3 4) 5)
=> (1 1 3 4 5)
- - Function: last LST N
+ - Function: last lst n
`last' returns the last N elements of LST. N must be a
non-negative integer.
@@ -8692,7 +9182,7 @@ Lists as sequences
(last '(1 2 3) 0)
=> 0
- - Function: butlast LST N
+ - Function: butlast lst n
`butlast' returns all but the last N elements of LST.
Example:
@@ -8708,7 +9198,7 @@ arugments.
(butlast '(a b c d e) 2)
=> (a b c)
- - Function: nthcdr N LST
+ - Function: nthcdr n lst
`nthcdr' takes N `cdr's of LST and returns the result. Thus
`(nthcdr 3 LST)' == `(cdddr LST)'
@@ -8718,14 +9208,14 @@ arugments.
(nthcdr 0 '(a b c d))
=> (a b c d)
- - Function: butnthcdr N LST
+ - Function: butnthcdr n lst
`butnthcdr' returns all but the nthcdr N elements of LST.
Example:
(butnthcdr 3 '(a b c d))
=> (a b c)
(butnthcdr 4 '(a b c d))
- => ()
+ => (a b c d)
`nthcdr' and `butnthcdr' split a list into two parts when given
identical arugments.
@@ -8743,10 +9233,10 @@ Destructive list operations
These procedures may mutate the list they operate on, but any such
mutation is undefined.
- - Procedure: nconc ARGS
+ - Procedure: nconc args
`nconc' destructively concatenates its arguments. (Compare this
with `append', which copies arguments rather than destroying them.)
- Sometimes called `append!' (*note Rev2 Procedures::.).
+ Sometimes called `append!' (*note Rev2 Procedures::).
Example: You want to find the subsets of a set. Here's the
obvious way:
@@ -8771,7 +9261,7 @@ mutation is undefined.
`nconc' is the same as `append!' in `sc2.scm'.
- - Procedure: nreverse LST
+ - Procedure: nreverse lst
`nreverse' reverses the order of elements in LST by mutating
`cdr's of the list. Sometimes called `reverse!'.
@@ -8791,9 +9281,9 @@ mutation is undefined.
(nreverse lst)
The example should suffice to show why this is the case.
- - Procedure: delete ELT LST
- - Procedure: delete-if PRED LST
- - Procedure: delete-if-not PRED LST
+ - Procedure: delete elt lst
+ - Procedure: delete-if pred lst
+ - Procedure: delete-if-not pred lst
Destructive versions of `remove' `remove-if', and `remove-if-not'.
Example:
@@ -8824,7 +9314,7 @@ File: slib.info, Node: Non-List functions, Prev: Destructive list operations,
Non-List functions
..................
- - Function: and? . ARGS
+ - Function: and? arg1 ... |
`and?' checks to see if all its arguments are true. If they are,
`and?' returns `#t', otherwise, `#f'. (In contrast to `and', this
is a function, so all arguments are always evaluated and in an
@@ -8836,7 +9326,7 @@ Non-List functions
(and #f 1 2)
=> #f
- - Function: or? . ARGS
+ - Function: or? arg1 ... |
`or?' checks to see if any of its arguments are true. If any is
true, `or?' returns `#t', and `#f' otherwise. (To `or' as `and?'
is to `and'.)
@@ -8847,7 +9337,7 @@ Non-List functions
(or? #f #f #f)
=> #f
- - Function: atom? OBJECT
+ - Function: atom? object
Returns `#t' if OBJECT is not a pair and `#f' if it is pair.
(Called `atom' in Common LISP.)
(atom? 1)
@@ -8857,17 +9347,9 @@ Non-List functions
(atom? #(1 2)) ; dubious!
=> #t
- - Function: type-of OBJECT
- Returns a symbol name for the type of OBJECT.
-
- - Function: coerce OBJECT RESULT-TYPE
- Converts and returns OBJECT of type `char', `number', `string',
- `symbol', `list', or `vector' to RESULT-TYPE (which must be one of
- these symbols).
-

-File: slib.info, Node: Tree Operations, Next: Chapter Ordering, Prev: Common List Functions, Up: Procedures
-
+File: slib.info, Node: Tree Operations, Next: Chapter Ordering, Prev: Common List Functions, Up: Sorting and Searching
+ |
Tree operations
---------------
@@ -8875,16 +9357,18 @@ Tree operations
These are operations that treat lists a representations of trees.
- - Function: subst NEW OLD TREE
- - Function: substq NEW OLD TREE
- - Function: substv NEW OLD TREE
+ - Function: subst new old tree
+ - Function: subst new old tree equ? |
+ - Function: substq new old tree
+ - Function: substv new old tree
`subst' makes a copy of TREE, substituting NEW for every subtree
or leaf of TREE which is `equal?' to OLD and returns a modified
tree. The original TREE is unchanged, but may share parts with
the result.
`substq' and `substv' are similar, but test against OLD using
- `eq?' and `eqv?' respectively.
+ `eq?' and `eqv?' respectively. If `subst' is called with a fourth |
+ argument, EQU? is the equality predicate. |
Examples:
(substq 'tempest 'hurricane '(shakespeare wrote (the hurricane)))
@@ -8895,7 +9379,7 @@ Tree operations
'((old . spice) ((old . shoes) old . pair) (old . pair)))
=> ((old . spice) ((old . shoes) a . cons) (a . cons))
- - Function: copy-tree TREE
+ - Function: copy-tree tree
Makes a copy of the nested list structure TREE using new pairs and
returns it. All levels are copied, so that none of the pairs in
the tree are `eq?' to the original ones - only the leaves are.
@@ -8908,8 +9392,8 @@ Tree operations
=> #f

-File: slib.info, Node: Chapter Ordering, Next: Sorting, Prev: Tree Operations, Up: Procedures
-
+File: slib.info, Node: Chapter Ordering, Next: Sorting, Prev: Tree Operations, Up: Sorting and Searching
+ |
Chapter Ordering
----------------
@@ -8920,7 +9404,7 @@ chapter numbers (or letters) in a book. Each section of the string
consists of consecutive numeric or consecutive aphabetic characters of
like case.
- - Function: chap:string<? STRING1 STRING2
+ - Function: chap:string<? string1 string2
Returns #t if the first non-matching run of alphabetic upper-case
or the first non-matching run of alphabetic lower-case or the first
non-matching run of numeric characters of STRING1 is `string<?'
@@ -8930,13 +9414,13 @@ like case.
(chap:string<? "4c" "4aa") => #t
(chap:string<? "Revised^{3.99}" "Revised^{4}") => #t
- - Function: chap:string>? STRING1 STRING2
- - Function: chap:string<=? STRING1 STRING2
- - Function: chap:string>=? STRING1 STRING2
+ - Function: chap:string>? string1 string2
+ - Function: chap:string<=? string1 string2
+ - Function: chap:string>=? string1 string2
Implement the corresponding chapter-order predicates.
- - Function: chap:next-string STRING
- Returns the next string in the *chapter order*. If STRING has no
+ - Function: chap:next-string string
+ Returns the next string in the _chapter order_. If STRING has no
alphabetic or numeric characters, `(string-append STRING "0")' is
returnd. The argument to chap:next-string will always be
`chap:string<?' than the result.
@@ -8947,15 +9431,15 @@ like case.
(chap:next-string "Revised^{4}") => "Revised^{5}"

-File: slib.info, Node: Sorting, Next: Topological Sort, Prev: Chapter Ordering, Up: Procedures
-
+File: slib.info, Node: Sorting, Next: Topological Sort, Prev: Chapter Ordering, Up: Sorting and Searching
+ |
Sorting
-------
`(require 'sort)'
Many Scheme systems provide some kind of sorting functions. They do
-not, however, always provide the *same* sorting functions, and those
+not, however, always provide the _same_ sorting functions, and those
that I have had the opportunity to test provided inefficient ones (a
common blunder is to use quicksort which does not perform well).
@@ -9008,7 +9492,7 @@ and Elk offers
14. The sort may be unstable.
All of this variation really does not help anybody. A nice simple
-merge sort is both stable and fast (quite a lot faster than *quick*
+merge sort is both stable and fast (quite a lot faster than _quick_
sort).
I am providing this source code with no restrictions at all on its use
@@ -9024,7 +9508,7 @@ converge on a single interface, and this may serve as a hint. The
argument order for all functions has been chosen to be as close to
Common LISP as made sense, in order to avoid NIH-itis.
- Each of the five functions has a required *last* parameter which is a
+ Each of the five functions has a required _last_ parameter which is a
comparison function. A comparison function `f' is a function of 2
arguments which acts like `<'. For example,
@@ -9034,9 +9518,9 @@ arguments which acts like `<'. For example,
The standard functions `<', `>', `char<?', `char>?', `char-ci<?',
`char-ci>?', `string<?', `string>?', `string-ci<?', and `string-ci>?'
are suitable for use as comparison functions. Think of `(less? x y)'
-as saying when `x' must *not* precede `y'.
+as saying when `x' must _not_ precede `y'.
- - Function: sorted? SEQUENCE LESS?
+ - Function: sorted? sequence less?
Returns `#t' when the sequence argument is in non-decreasing order
according to LESS? (that is, there is no adjacent pair `... x y
...' for which `(less? y x)').
@@ -9045,16 +9529,16 @@ as saying when `x' must *not* precede `y'.
pair. It is an error if the sequence is neither a list nor a
vector.
- - Function: merge LIST1 LIST2 LESS?
+ - Function: merge list1 list2 less?
This merges two lists, producing a completely new list as result.
I gave serious consideration to producing a Common-LISP-compatible
version. However, Common LISP's `sort' is our `sort!' (well, in
fact Common LISP's `stable-sort' is our `sort!', merge sort is
- *fast* as well as stable!) so adapting CL code to Scheme takes a
+ _fast_ as well as stable!) so adapting CL code to Scheme takes a
bit of work anyway. I did, however, appeal to CL to determine the
- *order* of the arguments.
+ _order_ of the arguments.
- - Procedure: merge! LIST1 LIST2 LESS?
+ - Procedure: merge! list1 list2 less?
Merges two lists, re-using the pairs of LIST1 and LIST2 to build
the result. If the code is compiled, and LESS? constructs no new
pairs, no pairs at all will be allocated. The first pair of the
@@ -9066,14 +9550,14 @@ as saying when `x' must *not* precede `y'.
done per iteration. (For example, we only have one `null?' test
per iteration.)
- - Function: sort SEQUENCE LESS?
+ - Function: sort sequence less?
Accepts either a list or a vector, and returns a new sequence
which is sorted. The new sequence is the same type as the input.
Always `(sorted? (sort sequence less?) less?)'. The original
sequence is not altered in any way. The new sequence shares its
- *elements* with the old one; no elements are copied.
+ _elements_ with the old one; no elements are copied.
- - Procedure: sort! SEQUENCE LESS?
+ - Procedure: sort! sequence less?
Returns its sorted result in the original boxes. If the original
sequence is a list, no new storage is allocated at all. If the
original sequence is a vector, the sorted elements are put back in
@@ -9086,7 +9570,7 @@ as saying when `x' must *not* precede `y'.
is the proper usage, not
(sort! slist <)
- Note that these functions do *not* accept a CL-style `:key' argument.
+ Note that these functions do _not_ accept a CL-style `:key' argument.
A simple device for obtaining the same expressiveness is to define
(define (keyed less? key)
(lambda (x y) (less? (key x) (key y))))
@@ -9100,8 +9584,8 @@ in Common LISP, just write
in Scheme.

-File: slib.info, Node: Topological Sort, Next: String-Case, Prev: Sorting, Up: Procedures
-
+File: slib.info, Node: Topological Sort, Next: String Search, Prev: Sorting, Up: Sorting and Searching
+ |
Topological Sort
----------------
@@ -9110,8 +9594,8 @@ Topological Sort
The algorithm is inspired by Cormen, Leiserson and Rivest (1990)
`Introduction to Algorithms', chapter 23.
- - Function: tsort DAG PRED
- - Function: topological-sort DAG PRED
+ - Function: tsort dag pred
+ - Function: topological-sort dag pred
where
DAG
is a list of sublists. The car of each sublist is a vertex.
@@ -9150,67 +9634,25 @@ The algorithm is inspired by Cormen, Leiserson and Rivest (1990)
(socks undershorts pants shoes watch shirt belt tie jacket)

-File: slib.info, Node: String-Case, Next: String Ports, Prev: Topological Sort, Up: Procedures
-
-String-Case
------------
-
- `(require 'string-case)'
-
- - Procedure: string-upcase STR
- - Procedure: string-downcase STR
- - Procedure: string-capitalize STR
- The obvious string conversion routines. These are non-destructive.
-
- - Function: string-upcase! STR
- - Function: string-downcase! STR
- - Function: string-captialize! STR
- The destructive versions of the functions above.
-
- - Function: string-ci->symbol STR
- Converts string STR to a symbol having the same case as if the
- symbol had been `read'.
-
-
-File: slib.info, Node: String Ports, Next: String Search, Prev: String-Case, Up: Procedures
-
-String Ports
-------------
-
- `(require 'string-port)'
-
- - Procedure: call-with-output-string PROC
- PROC must be a procedure of one argument. This procedure calls
- PROC with one argument: a (newly created) output port. When the
- function returns, the string composed of the characters written
- into the port is returned.
-
- - Procedure: call-with-input-string STRING PROC
- PROC must be a procedure of one argument. This procedure calls
- PROC with one argument: an (newly created) input port from which
- STRING's contents may be read. When PROC returns, the port is
- closed and the value yielded by the procedure PROC is returned.
-
-
-File: slib.info, Node: String Search, Next: Line I/O, Prev: String Ports, Up: Procedures
-
+File: slib.info, Node: String Search, Next: Sequence Comparison, Prev: Topological Sort, Up: Sorting and Searching
+ |
String Search
-------------
`(require 'string-search)'
- - Procedure: string-index STRING CHAR
- - Procedure: string-index-ci STRING CHAR
+ - Procedure: string-index string char
+ - Procedure: string-index-ci string char
Returns the index of the first occurence of CHAR within STRING, or
`#f' if the STRING does not contain a character CHAR.
- - Procedure: string-reverse-index STRING CHAR
- - Procedure: string-reverse-index-ci STRING CHAR
+ - Procedure: string-reverse-index string char
+ - Procedure: string-reverse-index-ci string char
Returns the index of the last occurence of CHAR within STRING, or
`#f' if the STRING does not contain a character CHAR.
- - procedure: substring? PATTERN STRING
- - procedure: substring-ci? PATTERN STRING
+ - procedure: substring? pattern string
+ - procedure: substring-ci? pattern string
Searches STRING to see if some substring of STRING is equal to
PATTERN. `substring?' returns the index of the first character of
the first substring of STRING that is equal to PATTERN; or `#f' if
@@ -9220,18 +9662,18 @@ String Search
(substring? "rat" "outrage") => #f
(substring? "" any-string) => 0
- - Procedure: find-string-from-port? STR IN-PORT MAX-NO-CHARS
+ - Procedure: find-string-from-port? str in-port max-no-chars
Looks for a string STR within the first MAX-NO-CHARS chars of the
input port IN-PORT.
- - Procedure: find-string-from-port? STR IN-PORT
+ - Procedure: find-string-from-port? str in-port
When called with two arguments, the search span is limited by the
end of the input stream.
- - Procedure: find-string-from-port? STR IN-PORT CHAR
+ - Procedure: find-string-from-port? str in-port char
Searches up to the first occurrence of character CHAR in STR.
- - Procedure: find-string-from-port? STR IN-PORT PROC
+ - Procedure: find-string-from-port? str in-port proc
Searches up to the first occurrence of the procedure PROC
returning non-false when called with a character (from IN-PORT)
argument.
@@ -9241,25 +9683,182 @@ String Search
read the first char after that (that is, after the STR) The
function returns `#f' when the STR isn't found.
- `find-string-from-port?' reads the port *strictly* sequentially,
+ `find-string-from-port?' reads the port _strictly_ sequentially,
and does not perform any buffering. So `find-string-from-port?'
can be used even if the IN-PORT is open to a pipe or other
communication channel.
- - Function: string-subst TXT OLD1 NEW1 ...
+ - Function: string-subst txt old1 new1 ...
Returns a copy of string TXT with all occurrences of string OLD1
in TXT replaced with NEW1, OLD2 replaced with NEW2 ....

-File: slib.info, Node: Line I/O, Next: Multi-Processing, Prev: String Search, Up: Procedures
-
+File: slib.info, Node: Sequence Comparison, Prev: String Search, Up: Sorting and Searching
+ |
+Sequence Comparison |
+------------------- |
+ |
+ `(require 'diff)' |
+ |
+This package implements the algorithm: |
+ |
+ S. Wu, E. Myers, U. Manber, and W. Miller, |
+ "An O(NP) Sequence Comparison Algorithm," |
+ Information Processing Letters 35, 6 (1990), 317-323. |
+ <http://www.cs.arizona.edu/people/gene/vita.html> |
+ |
+If the items being sequenced are text lines, then the computed |
+edit-list is equivalent to the output of the "diff" utility program. |
+If the items being sequenced are words, then it is like the lesser |
+known "spiff" program. |
+ |
+The values returned by `diff:edit-length' can be used to gauge the |
+degree of match between two sequences. |
+ |
+I believe that this algorithm is currently the fastest for these tasks, |
+but genome sequencing applications fuel extensive research in this area. |
+ |
+ - Function: diff:longest-common-subsequence array1 array2 =? |
+ - Function: diff:longest-common-subsequence array1 array2 |
+ ARRAY1 and ARRAY2 are one-dimensional arrays. The procedure =? is |
+ used to compare sequence tokens for equality. =? defaults to |
+ `eqv?'. `diff:longest-common-subsequence' returns a |
+ one-dimensional array of length `(quotient (- (+ len1 len2) |
+ (fp:edit-length ARRAY1 ARRAY2)) 2)' holding the longest sequence |
+ common to both ARRAYs. |
+ |
+ - Function: diff:edits array1 array2 =? |
+ - Function: diff:edits array1 array2 |
+ ARRAY1 and ARRAY2 are one-dimensional arrays. The procedure =? is |
+ used to compare sequence tokens for equality. =? defaults to |
+ `eqv?'. `diff:edits' returns a list of length `(fp:edit-length |
+ ARRAY1 ARRAY2)' composed of a shortest sequence of edits |
+ transformaing ARRAY1 to ARRAY2. |
+ |
+ Each edit is a list of an integer and a symbol: |
+ (J insert) |
+ Inserts `(array-ref ARRAY1 J)' into the sequence. |
+ |
+ (K delete) |
+ Deletes `(array-ref ARRAY2 K)' from the sequence. |
+ |
+ - Function: diff:edit-length array1 array2 =? |
+ - Function: diff:edit-length array1 array2 |
+ ARRAY1 and ARRAY2 are one-dimensional arrays. The procedure =? is |
+ used to compare sequence tokens for equality. =? defaults to |
+ `eqv?'. `diff:edit-length' returns the length of the shortest |
+ sequence of edits transformaing ARRAY1 to ARRAY2. |
+ |
+ (diff:longest-common-subsequence '#(f g h i e j c k l m) |
+ '#(f g e h i j k p q r l m)) |
+ => #(f g h i j k l m) |
+ |
+ (diff:edit-length '#(f g h i e j c k l m) |
+ '#(f g e h i j k p q r l m)) |
+ => 6 |
+ |
+ (pretty-print (diff:edits '#(f g h i e j c k l m) |
+ '#(f g e h i j k p q r l m))) |
+ -| |
+ ((3 insert) ; e |
+ (4 delete) ; c |
+ (6 delete) ; h |
+ (7 insert) ; p |
+ (8 insert) ; q |
+ (9 insert)) ; r |
+ |
+
+File: slib.info, Node: Procedures, Next: Standards Support, Prev: Sorting and Searching, Up: Other Packages
+ |
+Procedures |
+========== |
+ |
+ Anything that doesn't fall neatly into any of the other categories |
+winds up here. |
+ |
+* Menu: |
+ |
+* Type Coercion:: 'coerce |
+* String-Case:: 'string-case |
+* String Ports:: 'string-port |
+* Line I/O:: 'line-i/o |
+* Multi-Processing:: 'process |
+* Metric Units:: Portable manifest types for numeric values. |
+ |
+
+File: slib.info, Node: Type Coercion, Next: String-Case, Prev: Procedures, Up: Procedures
+ |
+Type Coercion |
+------------- |
+ |
+ `(require 'coerce)' |
+ |
+ - Function: type-of obj |
+ Returns a symbol name for the type of OBJ. |
+ |
+ - Function: coerce obj result-type |
+ Converts and returns OBJ of type `char', `number', `string', |
+ `symbol', `list', or `vector' to RESULT-TYPE (which must be one of |
+ these symbols). |
+ |
+
+File: slib.info, Node: String-Case, Next: String Ports, Prev: Type Coercion, Up: Procedures
+ |
+String-Case |
+----------- |
+ |
+ `(require 'string-case)' |
+ |
+ - Procedure: string-upcase str |
+ - Procedure: string-downcase str |
+ - Procedure: string-capitalize str |
+ The obvious string conversion routines. These are non-destructive. |
+ |
+ - Function: string-upcase! str |
+ - Function: string-downcase! str |
+ - Function: string-captialize! str |
+ The destructive versions of the functions above. |
+ |
+ - Function: string-ci->symbol str |
+ Converts string STR to a symbol having the same case as if the |
+ symbol had been `read'. |
+ |
+ - Function: symbol-append obj1 ... |
+ Converts OBJ1 ... to strings, appends them, and converts to a |
+ symbol which is returned. Strings and numbers are converted to |
+ read's symbol case; the case of symbol characters is not changed. |
+ #f is converted to the empty string (symbol). |
+ |
+
+File: slib.info, Node: String Ports, Next: Line I/O, Prev: String-Case, Up: Procedures
+ |
+String Ports |
+------------ |
+ |
+ `(require 'string-port)' |
+ |
+ - Procedure: call-with-output-string proc |
+ PROC must be a procedure of one argument. This procedure calls |
+ PROC with one argument: a (newly created) output port. When the |
+ function returns, the string composed of the characters written |
+ into the port is returned. |
+ |
+ - Procedure: call-with-input-string string proc |
+ PROC must be a procedure of one argument. This procedure calls |
+ PROC with one argument: an (newly created) input port from which |
+ STRING's contents may be read. When PROC returns, the port is |
+ closed and the value yielded by the procedure PROC is returned. |
+ |
+
+File: slib.info, Node: Line I/O, Next: Multi-Processing, Prev: String Ports, Up: Procedures
+ |
Line I/O
--------
`(require 'line-i/o)'
- Function: read-line
- - Function: read-line PORT
+ - Function: read-line port
Returns a string of the characters up to, but not including a
newline or end of file, updating PORT to point to the character
following the newline. If no characters are available, an end of
@@ -9267,8 +9866,8 @@ Line I/O
which case it defaults to the value returned by
`current-input-port'.
- - Function: read-line! STRING
- - Function: read-line! STRING PORT
+ - Function: read-line! string
+ - Function: read-line! string port
Fills STRING with characters up to, but not including a newline or
end of file, updating the PORT to point to the last character read
or following the newline if it was read. If no characters are
@@ -9278,20 +9877,20 @@ Line I/O
which case it defaults to the value returned by
`current-input-port'.
- - Function: write-line STRING
- - Function: write-line STRING PORT
+ - Function: write-line string
+ - Function: write-line string port
Writes STRING followed by a newline to the given PORT and returns
- an unspecified value. The PORT argument may be omited, in which
+ an unspecified value. The PORT argument may be omitted, in which
case it defaults to the value returned by `current-input-port'.
- - Function: display-file PATH
- - Function: display-file PATH PORT
+ - Function: display-file path
+ - Function: display-file path port
Displays the contents of the file named by PATH to PORT. The PORT
argument may be ommited, in which case it defaults to the value
returned by `current-output-port'.

-File: slib.info, Node: Multi-Processing, Prev: Line I/O, Up: Procedures
+File: slib.info, Node: Multi-Processing, Next: Metric Units, Prev: Line I/O, Up: Procedures
Multi-Processing
----------------
@@ -9303,7 +9902,7 @@ multi-processing in the SCM Scheme implementation using procedures
`alarm' and `alarm-interrupt'. Until this is ported to another
implementation, consider it an example of writing schedulers in Scheme.
- - Procedure: add-process! PROC
+ - Procedure: add-process! proc
Adds proc, which must be a procedure (or continuation) capable of
accepting accepting one argument, to the `process:queue'. The
value returned is unspecified. The argument to PROC should be
@@ -9316,7 +9915,201 @@ implementation, consider it an example of writing schedulers in Scheme.
- Procedure: kill-process!
Kills the current process and runs the next process from
`process:queue'. If there are no more processes on
- `process:queue', `(slib:exit)' is called (*note System::.).
+ `process:queue', `(slib:exit)' is called (*note System::).
+
+
+File: slib.info, Node: Metric Units, Prev: Multi-Processing, Up: Procedures
+
+Metric Units
+------------
+
+ `(require 'metric-units)'
+
+ <http://swissnet.ai.mit.edu/~jaffer/MIXF.html>
+
+ "Metric Interchange Format" is a character string encoding for
+numerical values and units which:
+
+ * is unambiguous in all locales;
+
+ * uses only [TOG] "Portable Character Set" characters matching "Basic
+ Latin" characters in Plane 0 of the Universal Character Set [UCS];
+
+ * is transparent to [UTF-7] and [UTF-8] UCS transformation formats;
+
+ * is human readable and writable;
+
+ * is machine readable and writable;
+
+ * incorporates SI prefixes and units;
+
+ * incorporates [ISO 6093] numbers; and
+
+ * incorporates [IEC 60027-2] binary prefixes.
+
+ In the expression for the value of a quantity, the unit symbol is
+placed after the numerical value. A dot (PERIOD, `.') is placed between
+the numerical value and the unit symbol.
+
+ Within a compound unit, each of the base and derived symbols can
+optionally have an attached SI prefix.
+
+ Unit symbols formed from other unit symbols by multiplication are
+indicated by means of a dot (PERIOD, `.') placed between them.
+
+ Unit symbols formed from other unit symbols by division are indicated
+by means of a SOLIDUS (`/') or negative exponents. The SOLIDUS must
+not be repeated in the same compound unit unless contained within a
+parenthesized subexpression.
+
+ The grouping formed by a prefix symbol attached to a unit symbol
+constitutes a new inseparable symbol (forming a multiple or submultiple
+of the unit concerned) which can be raised to a positive or negative
+power and which can be combined with other unit symbols to form compound
+unit symbols.
+
+ The grouping formed by surrounding compound unit symbols with
+parentheses (`(' and `)') constitutes a new inseparable symbol which
+can be raised to a positive or negative power and which can be combined
+with other unit symbols to form compound unit symbols.
+
+ Compound prefix symbols, that is, prefix symbols formed by the
+juxtaposition of two or more prefix symbols, are not permitted.
+
+ Prefix symbols are not used with the time-related unit symbols min
+(minute), h (hour), d (day). No prefix symbol may be used with dB
+(decibel). Only submultiple prefix symbols may be used with the unit
+symbols L (liter), Np (neper), o (degree), oC (degree Celsius), rad
+(radian), and sr (steradian). Submultiple prefix symbols may not be
+used with the unit symbols t (metric ton), r (revolution), or Bd (baud).
+
+ A unit exponent follows the unit, separated by a CIRCUMFLEX (`^').
+Exponents may be positive or negative. Fractional exponents must be
+parenthesized.
+
+SI Prefixes
+...........
+
+ Factor Name Symbol | Factor Name Symbol
+ ====== ==== ====== | ====== ==== ======
+ 1e24 yotta Y | 1e-1 deci d
+ 1e21 zetta Z | 1e-2 centi c
+ 1e18 exa E | 1e-3 milli m
+ 1e15 peta P | 1e-6 micro u
+ 1e12 tera T | 1e-9 nano n
+ 1e9 giga G | 1e-12 pico p
+ 1e6 mega M | 1e-15 femto f
+ 1e3 kilo k | 1e-18 atto a
+ 1e2 hecto h | 1e-21 zepto z
+ 1e1 deka da | 1e-24 yocto y
+
+Binary Prefixes
+...............
+
+ These binary prefixes are valid only with the units B (byte) and bit.
+However, decimal prefixes can also be used with bit; and decimal
+multiple (not submultiple) prefixes can also be used with B (byte).
+
+ Factor (power-of-2) Name Symbol
+ ====== ============ ==== ======
+ 1.152921504606846976e18 (2^60) exbi Ei
+ 1.125899906842624e15 (2^50) pebi Pi
+ 1.099511627776e12 (2^40) tebi Ti
+ 1.073741824e9 (2^30) gibi Gi
+ 1.048576e6 (2^20) mebi Mi
+ 1.024e3 (2^10) kibi Ki
+
+Unit Symbols
+............
+
+ Type of Quantity Name Symbol Equivalent
+ ================ ==== ====== ==========
+ time second s
+ time minute min = 60.s
+ time hour h = 60.min
+ time day d = 24.h
+ frequency hertz Hz s^-1
+ signaling rate baud Bd s^-1
+ length meter m
+ volume liter L dm^3
+ plane angle radian rad
+ solid angle steradian sr rad^2
+ plane angle revolution * r = 6.283185307179586.rad
+ plane angle degree * o = 2.777777777777778e-3.r
+ information capacity bit bit
+ information capacity byte, octet B = 8.bit
+ mass gram g
+ mass ton t Mg
+ mass unified atomic mass unit u = 1.66053873e-27.kg
+ amount of substance mole mol
+ catalytic activity katal kat mol/s
+ thermodynamic temperature kelvin K
+ centigrade temperature degree Celsius oC
+ luminous intensity candela cd
+ luminous flux lumen lm cd.sr
+ illuminance lux lx lm/m^2
+ force newton N m.kg.s^-2
+ pressure, stress pascal Pa N/m^2
+ energy, work, heat joule J N.m
+ energy electronvolt eV = 1.602176462e-19.J
+ power, radiant flux watt W J/s
+ logarithm of power ratio neper Np
+ logarithm of power ratio decibel * dB = 0.1151293.Np
+ electric current ampere A
+ electric charge coulomb C s.A
+ electric potential, EMF volt V W/A
+ capacitance farad F C/V
+ electric resistance ohm Ohm V/A
+ electric conductance siemens S A/V
+ magnetic flux weber Wb V.s
+ magnetic flux density tesla T Wb/m^2
+ inductance henry H Wb/A
+ radionuclide activity becquerel Bq s^-1
+ absorbed dose energy gray Gy m^2.s^-2
+ dose equivalent sievert Sv m^2.s^-2
+
+ * The formulas are:
+
+ * r/rad = 8 * atan(1)
+
+ * o/r = 1 / 360
+
+ * db/Np = ln(10) / 20
+
+ - Function: si:conversion-factor to-unit from-unit
+ If the strings FROM-UNIT and TO-UNIT express valid unit
+ expressions for quantities of the same unit-dimensions, then the
+ value returned by `si:conversion-factor' will be such that
+ multiplying a numerical value expressed in FROM-UNITs by the
+ returned conversion factor yields the numerical value expressed in
+ TO-UNITs.
+
+ Otherwise, `si:conversion-factor' returns:
+
+ -3
+ if neither FROM-UNIT nor TO-UNIT is a syntactically valid
+ unit.
+
+ -2
+ if FROM-UNIT is not a syntactically valid unit.
+
+ -1
+ if TO-UNIT is not a syntactically valid unit.
+
+ 0
+ if linear conversion (by a factor) is not possible.
+
+
+ (si:conversion-factor "km/s" "m/s" ) => 0.001
+ (si:conversion-factor "N" "m/s" ) => 0
+ (si:conversion-factor "moC" "oC" ) => 1000
+ (si:conversion-factor "mK" "oC" ) => 0
+ (si:conversion-factor "rad" "o" ) => 0.0174533
+ (si:conversion-factor "K" "o" ) => 0
+ (si:conversion-factor "K" "K" ) => 1
+ (si:conversion-factor "oK" "oK" ) => -3
+ (si:conversion-factor "" "s/s" ) => 1
+ (si:conversion-factor "km/h" "mph" ) => -2

File: slib.info, Node: Standards Support, Next: Session Support, Prev: Procedures, Up: Other Packages
@@ -9337,6 +10130,7 @@ Standards Support
* Dynamic-Wind:: 'dynamic-wind
* Eval:: 'eval
* Values:: 'values
+* SRFI:: 'http://srfi.schemers.org/srfi-0/srfi-0.html |

File: slib.info, Node: With-File, Next: Transcripts, Prev: Standards Support, Up: Standards Support
@@ -9346,8 +10140,8 @@ With-File
`(require 'with-file)'
- - Function: with-input-from-file FILE THUNK
- - Function: with-output-to-file FILE THUNK
+ - Function: with-input-from-file file thunk
+ - Function: with-output-to-file file thunk
Description found in R4RS.

@@ -9358,8 +10152,8 @@ Transcripts
`(require 'transcript)'
- - Function: transcript-on FILENAME
- - Function: transcript-off FILENAME
+ - Function: transcript-on filename
+ - Function: transcript-off filename
Redefines `read-char', `read', `write-char', `write', `display',
and `newline'.
@@ -9375,8 +10169,8 @@ Rev2 Procedures
Scheme'. *N.B.*: The symbols `1+' and `-1+' are not `R4RS' syntax.
Scheme->C, for instance, barfs on this module.
- - Procedure: substring-move-left! STRING1 START1 END1 STRING2 START2
- - Procedure: substring-move-right! STRING1 START1 END1 STRING2 START2
+ - Procedure: substring-move-left! string1 start1 end1 string2 start2
+ - Procedure: substring-move-right! string1 start1 end1 string2 start2
STRING1 and STRING2 must be a strings, and START1, START2 and END1
must be exact integers satisfying
@@ -9392,19 +10186,19 @@ Scheme->C, for instance, barfs on this module.
increasing indices. `substring-move-right!' stores characters in
time order of increasing indeces.
- - Procedure: substring-fill! STRING START END CHAR
+ - Procedure: substring-fill! string start end char
Fills the elements START-END of STRING with the character CHAR.
- - Function: string-null? STR
+ - Function: string-null? str
== `(= 0 (string-length STR))'
- - Procedure: append! . PAIRS
+ - Procedure: append! pair1 ... |
Destructively appends its arguments. Equivalent to `nconc'.
- - Function: 1+ N
+ - Function: 1+ n
Adds 1 to N.
- - Function: -1+ N
+ - Function: -1+ n
Subtracts 1 from N.
- Function: <?
@@ -9426,21 +10220,21 @@ Rev4 Optional Procedures
For the specification of these optional procedures, *Note Standard
procedures: (r4rs)Standard procedures.
- - Function: list-tail L P
+ - Function: list-tail l p
- - Function: string->list S
+ - Function: string->list s
- - Function: list->string L
+ - Function: list->string l
- Function: string-copy
- - Procedure: string-fill! S OBJ
+ - Procedure: string-fill! s obj
- - Function: list->vector L
+ - Function: list->vector l
- - Function: vector->list S
+ - Function: vector->list s
- - Procedure: vector-fill! S OBJ
+ - Procedure: vector-fill! s obj

File: slib.info, Node: Multi-argument / and -, Next: Multi-argument Apply, Prev: Rev4 Optional Procedures, Up: Standards Support
@@ -9454,15 +10248,15 @@ Multi-argument / and -
operations: (r4rs)Numerical operations. The `two-arg:'* forms are only
defined if the implementation does not support the many-argument forms.
- - Function: two-arg:/ N1 N2
+ - Function: two-arg:/ n1 n2
The original two-argument version of `/'.
- - Function: / DIVIDENT . DIVISORS
+ - Function: / dividend divisor1 ... |
- - Function: two-arg:- N1 N2
+ - Function: two-arg:- n1 n2
The original two-argument version of `-'.
- - Function: - MINUEND . SUBTRAHENDS
+ - Function: - minuend subtrahend1 ... |

File: slib.info, Node: Multi-argument Apply, Next: Rationalize, Prev: Multi-argument / and -, Up: Standards Support
@@ -9475,11 +10269,11 @@ Multi-argument Apply
For the specification of this optional form, *Note Control features:
(r4rs)Control features.
- - Function: two-arg:apply PROC L
+ - Function: two-arg:apply proc l
The implementation's native `apply'. Only defined for
implementations which don't support the many-argument version.
- - Function: apply PROC . ARGS
+ - Function: apply proc arg1 ... |

File: slib.info, Node: Rationalize, Next: Promises, Prev: Multi-argument Apply, Up: Standards Support
@@ -9489,15 +10283,33 @@ Rationalize
`(require 'rationalize)'
- The procedure rationalize is interesting because most programming
-languages do not provide anything analogous to it. For simplicity, we
-present an algorithm which computes the correct result for exact
-arguments (provided the implementation supports exact rational numbers
-of unlimited precision), and produces a reasonable answer for inexact
-arguments when inexact arithmetic is implemented using floating-point.
-We thank Alan Bawden for contributing this algorithm.
+ The procedure "rationalize" is interesting because most programming
+languages do not provide anything analogous to it. Thanks to Alan
+Bawden for contributing this algorithm.
+
+ - Function: rationalize x y
+ Computes the correct result for exact arguments (provided the
+ implementation supports exact rational numbers of unlimited
+ precision); and produces a reasonable answer for inexact arguments
+ when inexact arithmetic is implemented using floating-point.
+
+ `Rationalize' has limited use in implementations lacking exact
+(non-integer) rational numbers. The following procedures return a list
+of the numerator and denominator.
+
+ - Function: find-ratio x y
+ `find-ratio' returns the list of the _simplest_ numerator and
+ denominator whose quotient differs from X by no more than Y.
+
+ (find-ratio 3/97 .0001) => (3 97)
+ (find-ratio 3/97 .001) => (1 32)
+
+ - Function: find-ratio-between x y
+ `find-ratio-between' returns the list of the _simplest_ numerator
+ and denominator between X and Y.
- - Function: rationalize X E
+ (find-ratio-between 2/7 3/5) => (1 2)
+ (find-ratio-between -3/5 -2/7) => (-1 2)

File: slib.info, Node: Promises, Next: Dynamic-Wind, Prev: Rationalize, Up: Standards Support
@@ -9507,7 +10319,7 @@ Promises
`(require 'promise)'
- - Function: make-promise PROC
+ - Function: make-promise proc
Change occurrences of `(delay EXPRESSION)' to `(make-promise (lambda
() EXPRESSION))' and `(define force promise:force)' to implement
@@ -9526,7 +10338,7 @@ Dynamic-Wind
designed to take into account the fact that continuations produced by
`call-with-current-continuation' may be reentered.
- - Procedure: dynamic-wind THUNK1 THUNK2 THUNK3
+ - Procedure: dynamic-wind thunk1 thunk2 thunk3
The arguments THUNK1, THUNK2, and THUNK3 must all be procedures of
no arguments (thunks).
@@ -9552,7 +10364,7 @@ Eval
`(require 'eval)'
- - Function: eval EXPRESSION ENVIRONMENT-SPECIFIER
+ - Function: eval expression environment-specifier
Evaluates EXPRESSION in the specified environment and returns its
value. EXPRESSION must be a valid Scheme expression represented
as data, and ENVIRONMENT-SPECIFIER must be a value returned by one
@@ -9571,8 +10383,8 @@ Eval
(f + 10))
=> 20
- - Function: scheme-report-environment VERSION
- - Function: null-environment VERSION
+ - Function: scheme-report-environment version
+ - Function: null-environment version
- Function: null-environment
VERSION must be an exact non-negative integer N corresponding to a
version of one of the Revised^N Reports on Scheme.
@@ -9628,18 +10440,18 @@ Here are some more `eval' examples:
=> buick

-File: slib.info, Node: Values, Prev: Eval, Up: Standards Support
-
+File: slib.info, Node: Values, Next: SRFI, Prev: Eval, Up: Standards Support
+ |
Values
------
`(require 'values)'
- - Function: values OBJ ...
+ - Function: values obj ...
`values' takes any number of arguments, and passes (returns) them
to its continuation.
- - Function: call-with-values THUNK PROC
+ - Function: call-with-values thunk proc
THUNK must be a procedure of no arguments, and PROC must be a
procedure. `call-with-values' calls THUNK with a continuation
that, when passed some values, calls PROC with those values as
@@ -9652,8 +10464,180 @@ Values
unspecified.

+File: slib.info, Node: SRFI, Prev: Values, Up: Standards Support
+ |
+SRFI |
+---- |
+ |
+ `(require 'srfi)' |
+ |
+Implements "Scheme Request For Implementation" (SRFI) as described at |
+<http://srfi.schemers.org/> |
+ |
+The Copyright terms of each SRFI states: |
+ "However, this document itself may not be modified in any way, ..." |
+ |
+Therefore, the specification of SRFI constructs must not be quoted |
+without including the complete SRFI document containing discussion and |
+a sample implementation program. |
+ |
+ - Macro: cond-expand <clause1> <clause2> ... |
+ _Syntax:_ Each <clause> should be of the form |
+ |
+ (<feature> <expression1> ...) |
+ |
+ where <feature> is a boolean expression composed of symbols and |
+ `and', `or', and `not' of boolean expressions. The last <clause> |
+ may be an "else clause," which has the form |
+ |
+ (else <expression1> <expression2> ...). |
+ |
+ The first clause whose feature expression is satisfied is expanded. |
+ If no feature expression is satisfied and there is no else clause, |
+ an error is signaled. |
+ |
+ SLIB `cond-expand' is an extension of SRFI-0, |
+ <http://srfi.schemers.org/srfi-0/srfi-0.html>. |
+ |
+* Menu: |
+ |
+* SRFI-1:: list-processing |
+ |
+
+File: slib.info, Node: SRFI-1, Prev: SRFI, Up: SRFI
+ |
+SRFI-1 |
+...... |
+ |
+ `(require 'srfi-1)' |
+ |
+Implements the "SRFI-1" "list-processing library" as described at |
+<http://srfi.schemers.org/srfi-1/srfi-1.html> |
+ |
+Constructors |
+------------ |
+ |
+ - Function: xcons d a |
+ `(define (xcons d a) (cons a d))'. |
+ |
+ - Function: list-tabulate len proc |
+ Returns a list of length LEN. Element I is `(PROC I)' for 0 <= I |
+ < LEN. |
+ |
+ - Function: cons* obj1 obj2 |
+ |
+ - Function: iota count start step |
+ - Function: iota count start |
+ - Function: iota count |
+ Returns a list of COUNT numbers: (START, START+STEP, ..., |
+ START+(COUNT-1)*STEP). |
+ |
+ - Function: circular-list obj1 obj2 ... |
+ Returns a circular list of OBJ1, OBJ2, .... |
+ |
+Predicates |
+---------- |
+ |
+ - Function: proper-list? obj |
+ |
+ - Function: circular-list? x |
+ |
+ - Function: dotted-list? obj |
+ |
+ - Function: null-list? obj |
+ |
+ - Function: not-pair? obj |
+ |
+ - Function: list= =pred list ... |
+ |
+Selectors |
+--------- |
+ |
+ - Function: first pair |
+ - Function: fifth obj |
+ - Function: sixth obj |
+ - Function: seventh obj |
+ - Function: eighth obj |
+ - Function: ninth obj |
+ - Function: tenth obj |
+ |
+ - Function: car+cdr pair |
+ |
+ - Function: take lst k |
+ - Function: drop lst k |
+ |
+ - Function: take-right lst k |
+ |
+ - Function: split-at lst k |
+ |
+ - Function: last lst |
+ (car (last-pair lst)) |
+ |
+Miscellaneous |
+------------- |
+ |
+ - Function: length+ obj |
+ |
+ - Function: concatenate lists |
+ - Function: concatenate! lists |
+ |
+ - Function: reverse! lst |
+ |
+ - Function: append-reverse rev-head tail |
+ - Function: append-reverse! rev-head tail |
+ |
+ - Function: zip list1 list2 ... |
+ |
+ - Function: unzip1 lst |
+ - Function: unzip2 lst |
+ - Function: unzip3 lst |
+ - Function: unzip4 lst |
+ - Function: unzip5 lst |
+ |
+ - Function: count pred list1 list2 ... |
+ |
+Fold and Unfold |
+--------------- |
+ |
+Filtering and Partitioning |
+-------------------------- |
+ |
+Searching |
+--------- |
+ |
+ - Function: find pred list |
+ |
+ - Function: find-tail pred list |
+ |
+ - Function: member obj list pred |
+ - Function: member obj list |
+ `member' returns the first sublist of LIST whose car is OBJ, where |
+ the sublists of LIST are the non-empty lists returned by |
+ (list-tail LIST K) for K less than the length of LIST. If OBJ |
+ does not occur in LIST, then #f (not the empty list) is returned. |
+ The procedure PRED is used for testing equality. If PRED is not |
+ provided, `equal?' is used. |
+ |
+Deleting |
+-------- |
+ |
+Association lists |
+----------------- |
+ |
+ - Function: assoc obj alist pred |
+ - Function: assoc obj alist |
+ ALIST (for "association list") must be a list of pairs. These |
+ procedures find the first pair in ALIST whose car field is OBJ, and |
+ returns that pair. If no pair in ALIST has OBJ as its car, then #f |
+ (not the empty list) is returned. The procedure PRED is used for |
+ testing equality. If PRED is not provided, `equal?' is used. |
+ |
+Set operations |
+-------------- |
+ |
+
File: slib.info, Node: Session Support, Next: Extra-SLIB Packages, Prev: Standards Support, Up: Other Packages
-
+ |
Session Support
===============
@@ -9676,7 +10660,7 @@ Repl
Here is a read-eval-print-loop which, given an eval, evaluates forms.
- - Procedure: repl:top-level REPL:EVAL
+ - Procedure: repl:top-level repl:eval
`read's, `repl:eval's and `write's expressions from
`(current-input-port)' to `(current-output-port)' until an
end-of-file is encountered. `load', `slib:eval', `slib:error',
@@ -9717,11 +10701,11 @@ much improved.
Notice that the neccessity for truncating output eliminates
Common-Lisp's *Note Format:: from consideration; even when
variables `*print-level*' and `*print-level*' are set, huge
- strings and bit-vectors are *not* limited.
+ strings and bit-vectors are _not_ limited.
- - Procedure: qp ARG1 ...
- - Procedure: qpn ARG1 ...
- - Procedure: qpr ARG1 ...
+ - Procedure: qp arg1 ...
+ - Procedure: qpn arg1 ...
+ - Procedure: qpr arg1 ...
`qp' writes its arguments, separated by spaces, to
`(current-output-port)'. `qp' compresses printing by substituting
`...' for substructure it does not have sufficient room to print.
@@ -9749,13 +10733,21 @@ printer for `qp'. This example shows how to do this:
(provide 'qp)
(require 'debug)
- - Procedure: trace-all FILE
- Traces (*note Trace::.) all procedures `define'd at top-level in
- file `file'.
+ - Procedure: trace-all file ...
+ Traces (*note Trace::) all procedures `define'd at top-level in
+ `file' ....
- - Procedure: break-all FILE
- Breakpoints (*note Breakpoints::.) all procedures `define'd at
- top-level in file `file'.
+ - Procedure: track-all file ...
+ Tracks (*note Trace::) all procedures `define'd at top-level in
+ `file' ....
+
+ - Procedure: stack-all file ...
+ Stacks (*note Trace::) all procedures `define'd at top-level in
+ `file' ....
+
+ - Procedure: break-all file ...
+ Breakpoints (*note Breakpoints::) all procedures `define'd at
+ top-level in `file' ....

File: slib.info, Node: Breakpoints, Next: Trace, Prev: Debug, Up: Session Support
@@ -9772,7 +10764,7 @@ Breakpoints
establish a top-level continuation. Typing `(init-debug)' at top
level sets up a continuation for `break'.
- - Function: breakpoint ARG1 ...
+ - Function: breakpoint arg1 ...
Returns from the top level continuation and pushes the
continuation from which it was called on a continuation stack.
@@ -9780,11 +10772,11 @@ Breakpoints
Pops the topmost continuation off of the continuation stack and
returns an unspecified value to it.
- - Function: continue ARG1 ...
+ - Function: continue arg1 ...
Pops the topmost continuation off of the continuation stack and
returns ARG1 ... to it.
- - Macro: break PROC1 ...
+ - Macro: break proc1 ...
Redefines the top-level named procedures given as arguments so that
`breakpoint' is called before calling PROC1 ....
@@ -9793,22 +10785,18 @@ Breakpoints
identifiers are broken (even if those identifiers have been
redefined) and returns a list of the broken identifiers.
- - Macro: unbreak PROC1 ...
+ - Macro: unbreak proc1 ...
Turns breakpoints off for its arguments.
- Macro: unbreak
With no arguments, unbreaks all currently broken identifiers and
returns a list of these formerly broken identifiers.
- The following routines are the procedures which actually do the
-tracing when this module is supplied by SLIB, rather than natively. If
-defmacros are not natively supported by your implementation, these might
-be more convenient to use.
+ These are _procedures_ for breaking. If defmacros are not natively
+supported by your implementation, these might be more convenient to use.
- - Function: breakf PROC
- - Function: breakf PROC NAME
- - Function: debug:breakf PROC
- - Function: debug:breakf PROC NAME
+ - Function: breakf proc
+ - Function: breakf proc name
To break, type
(set! SYMBOL (breakf SYMBOL))
@@ -9821,8 +10809,7 @@ be more convenient to use.
or
(define SYMBOL (breakf FUNCTION 'SYMBOL))
- - Function: unbreakf PROC
- - Function: debug:unbreakf PROC
+ - Function: unbreakf proc
To unbreak, type
(set! SYMBOL (unbreakf SYMBOL))
@@ -9834,7 +10821,31 @@ Tracing
`(require 'trace)'
- - Macro: trace PROC1 ...
+This feature provides three ways to monitor procedure invocations:
+
+stack
+ Pushes the procedure-name when the procedure is called; pops when
+ it returns.
+
+track
+ Pushes the procedure-name and arguments when the procedure is
+ called; pops when it returns.
+
+trace
+ Pushes the procedure-name and prints `CALL PROCEDURE-NAME ARG1
+ ...' when the procdure is called; pops and prints `RETN
+ PROCEDURE-NAME VALUE' when the procedure returns.
+
+ - Variable: debug:max-count
+ If a traced procedure calls itself or untraced procedures which
+ call it, stack, track, and trace will limit the number of stack
+ pushes to DEBUG:MAX-COUNT.
+
+ - Function: print-call-stack
+ - Function: print-call-stack port
+ Prints the call-stack to PORT or the current-error-port.
+
+ - Macro: trace proc1 ...
Traces the top-level named procedures given as arguments.
- Macro: trace
@@ -9842,22 +10853,48 @@ Tracing
identifiers are traced (even if those identifiers have been
redefined) and returns a list of the traced identifiers.
- - Macro: untrace PROC1 ...
- Turns tracing off for its arguments.
+ - Macro: track proc1 ...
+ Traces the top-level named procedures given as arguments.
+
+ - Macro: track
+ With no arguments, makes sure that all the currently tracked
+ identifiers are tracked (even if those identifiers have been
+ redefined) and returns a list of the tracked identifiers.
+
+ - Macro: stack proc1 ...
+ Traces the top-level named procedures given as arguments.
+
+ - Macro: stack
+ With no arguments, makes sure that all the currently stacked
+ identifiers are stacked (even if those identifiers have been
+ redefined) and returns a list of the stacked identifiers.
+
+ - Macro: untrace proc1 ...
+ Turns tracing, tracking, and off for its arguments.
- Macro: untrace
With no arguments, untraces all currently traced identifiers and
returns a list of these formerly traced identifiers.
- The following routines are the procedures which actually do the
-tracing when this module is supplied by SLIB, rather than natively. If
-defmacros are not natively supported by your implementation, these might
-be more convenient to use.
+ - Macro: untrack proc1 ...
+ Turns tracing, tracking, and off for its arguments.
+
+ - Macro: untrack
+ With no arguments, untracks all currently tracked identifiers and
+ returns a list of these formerly tracked identifiers.
+
+ - Macro: unstack proc1 ...
+ Turns tracing, stacking, and off for its arguments.
+
+ - Macro: unstack
+ With no arguments, unstacks all currently stacked identifiers and
+ returns a list of these formerly stacked identifiers.
- - Function: tracef PROC
- - Function: tracef PROC NAME
- - Function: debug:tracef PROC
- - Function: debug:tracef PROC NAME
+ These are _procedures_ for tracing. If defmacros are not natively
+supported by your implementation, these might be more convenient to use.
+
+ - Function: tracef proc
+ - Function: tracef proc name
To trace, type
(set! SYMBOL (tracef SYMBOL))
@@ -9870,9 +10907,8 @@ be more convenient to use.
or
(define SYMBOL (tracef FUNCTION 'SYMBOL))
- - Function: untracef PROC
- - Function: debug:untracef PROC
- To untrace, type
+ - Function: untracef proc
+ Removes tracing, tracking, or stacking for PROC. To untrace, type
(set! SYMBOL (untracef SYMBOL))

@@ -9883,14 +10919,14 @@ System Interface
If `(provided? 'getenv)':
- - Function: getenv NAME
+ - Function: getenv name
Looks up NAME, a string, in the program environment. If NAME is
found a string of its value is returned. Otherwise, `#f' is
returned.
If `(provided? 'system)':
- - Function: system COMMAND-STRING
+ - Function: system command-string
Executes the COMMAND-STRING on the computer and returns the
integer status code.
@@ -9900,8 +10936,8 @@ mail, and Netscape.
`(require 'net-clients)'
- - Function: call-with-tmpnam PROC
- - Function: call-with-tmpnam PROC K
+ - Function: call-with-tmpnam proc
+ - Function: call-with-tmpnam proc k
Calls PROC with K arguments, strings returned by successive calls
to `tmpnam'. If PROC returns, then any files named by the
arguments to PROC are deleted automatically and the value(s)
@@ -9921,25 +10957,25 @@ mail, and Netscape.
If `current-directory' cannot be supported by the platform, the
value of `current-directory' is #f.
- - Function: make-directory NAME
+ - Function: make-directory name
Creates a sub-directory NAME of the current-directory. If
successful, `make-directory' returns #t; otherwise #f.
- - Function: null-directory? FILE-NAME
+ - Function: null-directory? file-name
Returns #t if changing directory to FILE-NAME makes the current
working directory the same as it is before changing directory;
otherwise returns #f.
- - Function: absolute-path? FILE-NAME
+ - Function: absolute-path? file-name
Returns #t if FILE-NAME is a fully specified pathname (does not
depend on the current working directory); otherwise returns #f.
- - Function: glob-pattern? STR
+ - Function: glob-pattern? str
Returns #t if the string STR contains characters used for
specifying glob patterns, namely `*', `?', or `['.
- - Function: parse-ftp-address URL
- Returns a list of the decoded FTP URL; or #f if indecipherable.
+ - Function: parse-ftp-address uri
+ Returns a list of the decoded FTP URI; or #f if indecipherable.
FTP "Uniform Resource Locator", "ange-ftp", and "getit" formats
are handled. The returned list has four elements which are
strings or #f:
@@ -9952,9 +10988,9 @@ mail, and Netscape.
3. remote-directory
- - Function: ftp-upload PATHS USER PASSWORD REMOTE-SITE REMOTE-DIR
+ - Function: ftp-upload paths user password remote-site remote-dir
PASSWORD must be a non-empty string or #f. PATHS must be a
- non-empty list of pathnames or Glob patterns (*note Filenames::.)
+ non-empty list of pathnames or Glob patterns (*note Filenames::)
matching files to transfer.
`ftp-upload' puts the files specified by PATHS into the REMOTE-DIR
@@ -9965,19 +11001,19 @@ mail, and Netscape.
is ignored; FTP takes the username and password from the `.netrc'
or equivalent file.
- - Function: path->url PATH
- Returns a URL-string for PATH on the local host.
+ - Function: path->uri path
+ Returns a URI-string for PATH on the local host.
- - Function: browse-url-netscape URL
+ - Function: browse-url-netscape url
If a `netscape' browser is running, `browse-url-netscape' causes
the browser to display the page specified by string URL and
returns #t.
If the browser is not running, `browse-url-netscape' runs
- `netscape' with the argument URL. If the browser starts as a |
- background job, `browse-url-netscape' returns #t immediately; if |
- the browser starts as a foreground job, then `browse-url-netscape' |
- returns #t when the browser exits; otherwise it returns #f. |
+ `netscape' with the argument URL. If the browser starts as a
+ background job, `browse-url-netscape' returns #t immediately; if
+ the browser starts as a foreground job, then `browse-url-netscape'
+ returns #t when the browser exits; otherwise it returns #f.

File: slib.info, Node: Extra-SLIB Packages, Prev: Session Support, Up: Other Packages
@@ -10005,11 +11041,17 @@ distribution:
as easily as any other SLIB package. Some optional packages (for which
`*catalog*' already has entries) available from SLIB sites are:
-SLIB-PSD is a portable debugger for Scheme (requires emacs editor).
- http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz |
- ftp.gnu.org:pub/gnu/jacal/slib-psd1-3.tar.gz
- ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz
- ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz
+SLIB-PSD
+ is a portable debugger for Scheme (requires emacs editor).
+
+ http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz
+
+ swissnet.ai.mit.edu:/pub/scm/slib-psd1-3.tar.gz
+
+ ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz
+
+ ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz
+
With PSD, you can run a Scheme program in an Emacs buffer, set
breakpoints, single step evaluation and access and modify the
@@ -10018,13 +11060,21 @@ SLIB-PSD is a portable debugger for Scheme (requires emacs editor).
tested with SCM, Elk 1.5, and the sci interpreter in the Scheme->C
system, but should work with other Schemes with a minimal amount
of porting, if at all. Includes documentation and user's manual.
- Written by Pertti Kellom\"aki, pk@cs.tut.fi. The Lisp Pointers
+ Written by Pertti Kellom\"aki, pk @ cs.tut.fi. The Lisp Pointers
article describing PSD (Lisp Pointers VI(1):15-23, January-March
1993) is available as
- `http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html'
+ http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html
+
-SCHELOG is an embedding of Prolog in Scheme.
- `http://www.cs.rice.edu/CS/PLT/packages/schelog/'
+SCHELOG
+ is an embedding of Prolog in Scheme.
+ http://www.cs.rice.edu/CS/PLT/packages/schelog/
+
+
+JFILTER
+ is a Scheme program which converts text among the JIS, EUC, and
+ Shift-JIS Japanese character sets.
+ http://www.sci.toyama-u.ac.jp/~iwao/Scheme/Jfilter/index.html

File: slib.info, Node: About SLIB, Next: Index, Prev: Other Packages, Up: Top
@@ -10032,30 +11082,55 @@ File: slib.info, Node: About SLIB, Next: Index, Prev: Other Packages, Up: To
About SLIB
**********
-More people than I can name have contributed to SLIB. Thanks to all of |
-you! |
- |
- SLIB 2c7, released December 1999. |
- Aubrey Jaffer <jaffer @ ai.mit.edu> |
- Hyperactive Software - The Maniac Inside! |
- `http://swissnet.ai.mit.edu/~jaffer/SLIB.html' |
- |
+More people than I can name have contributed to SLIB. Thanks to all of
+you!
+
+ SLIB 2d2, released July 2001. |
+ Aubrey Jaffer <agj @ alum.mit.edu> |
+ Hyperactive Software - The Maniac Inside!
+ <http://swissnet.ai.mit.edu/~jaffer/SLIB.html>
+
* Menu:
* Installation:: How to install SLIB on your system.
* Porting:: SLIB to new platforms.
-* Coding Standards:: How to write modules for SLIB.
+* Coding Guidelines:: How to write modules for SLIB.
* Copyrights:: Intellectual propery issues.
- |
+

File: slib.info, Node: Installation, Next: Porting, Prev: About SLIB, Up: About SLIB
Installation
============
- Check the manifest in `README' to find a configuration file for your
-Scheme implementation. Initialization files for most IEEE P1178
-compliant Scheme Implementations are included with this distribution.
+ There are four parts to installation: |
+ |
+ * Unpack the SLIB distribution. |
+ |
+ * Configure the Scheme implementation(s) to locate the SLIB |
+ directory. |
+ |
+ * Arrange for Scheme implementation to load its SLIB initialization |
+ file. |
+ |
+ * Build the SLIB catalog for the Scheme implementation. |
+ |
+Unpacking the SLIB Distribution |
+------------------------------- |
+ |
+ If the SLIB distribution is a Linux RPM, it will create the SLIB |
+directory `/usr/share/slib'. |
+ |
+ If the SLIB distribution is a ZIP file, unzip the distribution to |
+create the SLIB directory. Locate this `slib' directory either in your |
+home directory (if only you will use this SLIB installation); or put it |
+in a location where libraries reside on your system. On unix systems |
+this might be `/usr/share/slib', `/usr/local/lib/slib', or |
+`/usr/lib/slib'. If you know where SLIB should go on other platforms, |
+please inform agj @ alum.mit.edu. |
+ |
+Configure Scheme Implementation to Locate SLIB |
+---------------------------------------------- |
If the Scheme implementation supports `getenv', then the value of the
shell environment variable SCHEME_LIBRARY_PATH will be used for
@@ -10064,33 +11139,104 @@ MITScheme, scheme->c, VSCM, and SCM support `getenv'. Scheme48
supports `getenv' but does not use it for determining
`library-vicinity'. (That is done from the Makefile.)
+ The `(library-vicinity)' can also be specified from the SLIB |
+initialization file or by implementation-specific means. |
+ |
+Loading SLIB Initialization File |
+-------------------------------- |
+ |
+ Check the manifest in `README' to find a configuration file for your |
+Scheme implementation. Initialization files for most IEEE P1178 |
+compliant Scheme Implementations are included with this distribution. |
+ |
You should check the definitions of `software-type',
`scheme-implementation-version', `implementation-vicinity', and
`library-vicinity' in the initialization file. There are comments in
the file for how to configure it.
- Once this is done you can modify the startup file for your Scheme
-implementation to `load' this initialization file. SLIB is then
-installed.
+ Once this is done, modify the startup file for your Scheme |
+implementation to `load' this initialization file. |
+ |
+Build New SLIB Catalog for Implementation |
+----------------------------------------- |
+ |
+ When SLIB is first used from an implementation, a file named |
+`slibcat' is written to the `implementation-vicinity' for that |
+implementation. Because users may lack permission to write in |
+`implementation-vicinity', it is good practice to build the new catalog |
+when installing SLIB. |
+ |
+ To build (or rebuild) the catalog, start the Scheme implementation |
+(with SLIB), then: |
+ |
+ (require 'new-catalog) |
+ |
+Implementation-specific Instructions |
+------------------------------------ |
Multiple implementations of Scheme can all use the same SLIB
directory. Simply configure each implementation's initialization file
as outlined above.
- The SCM implementation does not require any initialization file as
-SLIB support is already built in to SCM. See the documentation with
-SCM for installation instructions.
+ - Implementation: SCM
+ The SCM implementation does not require any initialization file as
+ SLIB support is already built into SCM. See the documentation
+ with SCM for installation instructions.
+
+ - Implementation: VSCM
+ From: Matthias Blume <blume @ cs.Princeton.EDU>
+ Date: Tue, 1 Mar 1994 11:42:31 -0500
+
+ Disclaimer: The code below is only a quick hack. If I find some
+ time to spare I might get around to make some more things work.
+
+ You have to provide `vscm.init' as an explicit command line
+ argument. Since this is not very nice I would recommend the
+ following installation procedure:
+
+ 1. run scheme
+
+ 2. `(load "vscm.init")'
+
+ 3. `(slib:dump "dumpfile")'
+
+ 4. mv dumpfile place-where-vscm-standard-bootfile-resides e.g.
+ mv dumpfile /usr/local/vscm/lib/scheme-boot (In this case
+ vscm should have been compiled with flag
+ -DDEFAULT_BOOTFILE='"/usr/local/vscm/lib/scheme-boot"'. See
+ Makefile (definition of DDP) for details.)
- SLIB includes methods to create heap images for the VSCM and Scheme48
-implementations. The instructions for creating a VSCM image are in
-comments in `vscm.init'. To make a Scheme48 image for an installation
-under `<prefix>', `cd' to the SLIB directory and type `make
-prefix=<prefix> slib48'. To install the image, type `make
-prefix=<prefix> install48'. This will also create a shell script with
-the name `slib48' which will invoke the saved image.
+
+ - Implementation: Scheme48
+ To make a Scheme48 image for an installation under `<prefix>',
+
+ 1. `cd' to the SLIB directory
+
+ 2. type `make prefix=<prefix> slib48'.
+
+ 3. To install the image, type `make prefix=<prefix> install48'.
+ This will also create a shell script with the name `slib48'
+ which will invoke the saved image.
+
+ - Implementation: PLT Scheme
+ - Implementation: DrScheme
+ - Implementation: MzScheme
+ The `init.ss' file in the _slibinit_ collection is an SLIB |
+ initialization file. |
+ |
+ To use SLIB in MzScheme, set the SCHEME_LIBRARY_PATH environment |
+ variable to the installed SLIB location; then invoke MzScheme thus: |
+ |
+ `mzscheme -L init.ss slibinit' |
+ |
+ - Implementation: MIT Scheme |
+ `scheme -load ${SCHEME_LIBRARY_PATH}mitscheme.init' |
+
+ - Implementation: Guile |
+ `guile -l ${SCHEME_LIBRARY_PATH}guile.init' |

-File: slib.info, Node: Porting, Next: Coding Standards, Prev: Installation, Up: About SLIB
+File: slib.info, Node: Porting, Next: Coding Guidelines, Prev: Installation, Up: About SLIB
Porting
=======
@@ -10114,7 +11260,7 @@ library; this will allow the use of `provide', `provided?', and
documented in the section *Note Require::). The rest of the library
will then be accessible in a system independent fashion.
- Please mail new working configuration files to `jaffer @ ai.mit.edu'
+ Please mail new working configuration files to `agj @ alum.mit.edu' |
so that they can be included in the SLIB distribution.
---------- Footnotes ----------
@@ -10124,16 +11270,16 @@ Language Scheme' implementation, then you will need to finish writing
`sc4sc3.scm' and `load' it from your initialization file.

-File: slib.info, Node: Coding Standards, Next: Copyrights, Prev: Porting, Up: About SLIB
+File: slib.info, Node: Coding Guidelines, Next: Copyrights, Prev: Porting, Up: About SLIB
-Coding Standards
-================
+Coding Guidelines
+=================
All library packages are written in IEEE P1178 Scheme and assume that
a configuration file and `require.scm' package have already been
loaded. Other versions of Scheme can be supported in library packages
as well by using, for example, `(provided? 'rev3-report)' or `(require
-'rev3-report)' (*note Require::.).
+'rev3-report)' (*note Require::).
The module name and `:' should prefix each symbol defined in the
package. Definitions for external use should then be exported by having
@@ -10149,7 +11295,7 @@ packages.
But documentation must be provided.
Your package will be released sooner with SLIB if you send me a file
-which tests your code. Please run this test *before* you send me the
+which tests your code. Please run this test _before_ you send me the
code!
Modifications
@@ -10168,13 +11314,13 @@ files).
please try to contact the author, who may be working on a new version.
This will insure against wasting effort on obsolete versions.
- Please *do not* reformat the source code with your favorite
+ Please _do not_ reformat the source code with your favorite
beautifier, make 10 fixes, and send me the resulting source code. I do
not have the time to fish through 10000 diffs to find your 10 real
fixes.

-File: slib.info, Node: Copyrights, Prev: Coding Standards, Up: About SLIB
+File: slib.info, Node: Copyrights, Prev: Coding Guidelines, Up: About SLIB
Copyrights
==========
@@ -10193,8 +11339,8 @@ Putting code into the Public Domain
-----------------------------------
In order to put code in the public domain you should sign a copyright
-disclaimer and send it to the SLIB maintainer. Contact jaffer @
-ai.mit.edu for the address to mail the disclaimer to.
+disclaimer and send it to the SLIB maintainer. Contact agj @ |
+alum.mit.edu for the address to mail the disclaimer to. |
I, NAME, hereby affirm that I have placed the software package
NAME in the public domain.
@@ -10215,7 +11361,7 @@ revisions of that module.
Make sure no employer has any claim to the copyright on the work you
are submitting. If there is any doubt, create a copyright disclaimer
and have your employer sign it. Mail the signed disclaimer to the SLIB
-maintainer. Contact jaffer @ ai.mit.edu for the address to mail the
+maintainer. Contact agj @ alum.mit.edu for the address to mail the |
disclaimer to. An example disclaimer follows.
Explicit copying terms
@@ -10233,7 +11379,7 @@ into the Public Domain (by sending me a disclaimer) you need to:
* Make sure no employer has any claim to the copyright on the work
you are submitting. If there is any doubt, create a copyright
disclaimer and have your employer sign it. Mail the signed
- disclaim to the SLIB maintainer. Contact jaffer @ ai.mit.edu for
+ disclaim to the SLIB maintainer. Contact agj @ alum.mit.edu for |
the address to mail the disclaimer to.
Example: Company Copyright Disclaimer
@@ -10290,13 +11436,9 @@ Procedure and Macro Index
* and?: Non-List functions.
* any?: Collections.
* append!: Rev2 Procedures.
-* apply: Multi-argument Apply.
-* array-1d-ref: Arrays.
-* array-1d-set!: Arrays.
-* array-2d-ref: Arrays.
-* array-2d-set!: Arrays.
-* array-3d-ref: Arrays.
-* array-3d-set!: Arrays.
+* append-reverse: SRFI-1. |
+* append-reverse!: SRFI-1. |
+* apply: Multi-argument Apply. |
* array-copy!: Array Mapping.
* array-dimensions: Arrays.
* array-for-each: Array Mapping.
@@ -10308,20 +11450,22 @@ Procedure and Macro Index
* array-ref: Arrays.
* array-set!: Arrays.
* array-shape: Arrays.
+* array=?: Arrays. |
* array?: Arrays.
* asctime: Posix Time.
* ash: Bit-Twiddling.
-* atom?: Non-List functions. |
+* assoc: SRFI-1. |
+* atom?: Non-List functions.
* batch:call-with-output-script: Batch.
-* batch:command: Batch. |
+* batch:command: Batch.
* batch:comment: Batch.
* batch:delete-file: Batch.
* batch:initialize!: Batch.
* batch:lines->file: Batch.
* batch:rename-file: Batch.
* batch:run-script: Batch.
-* batch:try-chopped-command: Batch. |
-* batch:try-command: Batch. |
+* batch:try-chopped-command: Batch.
+* batch:try-command: Batch.
* bit-extract: Bit-Twiddling.
* bit-field: Bit-Twiddling.
* bitwise-if: Bit-Twiddling.
@@ -10344,30 +11488,38 @@ Procedure and Macro Index
* call-with-tmpnam: System Interface.
* call-with-values: Values.
* capture-syntactic-environment: Syntactic Closures.
+* car+cdr: SRFI-1. |
* cart-prod-tables: Relational Database Operations.
-* catalog->html: HTML HTTP and CGI.
-* catalog->page: HTML HTTP and CGI.
-* cgi:read-query-string: HTML HTTP and CGI.
-* cgi:serve-command: HTML HTTP and CGI.
+* catalog->html: HTML Tables.
+* cgi:serve-query: HTTP and CGI.
* chap:next-string: Chapter Ordering.
* chap:string<=?: Chapter Ordering.
* chap:string<?: Chapter Ordering.
* chap:string>=?: Chapter Ordering.
* chap:string>?: Chapter Ordering.
* check-parameters: Parameter lists.
+* circular-list: SRFI-1. |
+* circular-list?: SRFI-1. |
* close-base: Base Table.
* close-database: Relational Database Operations.
* close-table: Table Operations.
-* coerce: Non-List functions.
+* coerce: Type Coercion.
* collection?: Collections.
* combined-rulesets: Commutative Rings.
-* command->html: HTML HTTP and CGI.
+* command->p-specs: HTML.
+* command:make-editable-table: HTML Tables.
+* command:modify-table: HTML Tables.
+* concatenate: SRFI-1. |
+* concatenate!: SRFI-1. |
+* cond-expand: SRFI. |
+* cons*: SRFI-1. |
* continue: Breakpoints.
* copy-bit: Bit-Twiddling.
* copy-bit-field: Bit-Twiddling.
* copy-list: List construction.
* copy-random-state: Random Numbers.
* copy-tree: Tree Operations.
+* count: SRFI-1. |
* create-database <1>: Database Utilities.
* create-database: Creating and Opening Relational Databases.
* create-report: Database Reports.
@@ -10381,15 +11533,13 @@ Procedure and Macro Index
* current-input-port: Ruleset Definition and Use.
* current-output-port: Byte.
* current-time: Time and Date.
-* debug:breakf: Breakpoints.
-* debug:tracef: Trace.
-* debug:unbreakf: Breakpoints.
-* debug:untracef: Trace.
+* db->html-directory: HTML Tables.
+* db->html-files: HTML Tables.
+* db->netscape: HTML Tables.
* decode-universal-time: Common-Lisp Time.
* define-access-operation: Setters.
* define-operation: Yasos interface.
-* define-predicate: Yasos interface.
-* define-record: Structures.
+* define-predicate: Yasos interface. |
* define-syntax: Macro by Example.
* define-tables: Database Utilities.
* defmacro: Defmacro.
@@ -10406,15 +11556,22 @@ Procedure and Macro Index
* delete-if-not: Destructive list operations.
* delete-table: Relational Database Operations.
* dequeue!: Queues.
+* determinant: Determinant.
+* diff:edit-length: Sequence Comparison. |
+* diff:edits: Sequence Comparison. |
+* diff:longest-common-subsequence: Sequence Comparison. |
* difftime: Time and Date.
* display-file: Line I/O.
* do-elts: Collections.
* do-keys: Collections.
* domain-checker: Database Utilities.
+* dotted-list?: SRFI-1. |
+* drop: SRFI-1. |
* dynamic-ref: Dynamic Data Type.
* dynamic-set!: Dynamic Data Type.
* dynamic-wind: Dynamic-Wind.
* dynamic?: Dynamic Data Type.
+* eighth: SRFI-1. |
* empty?: Collections.
* encode-universal-time: Common-Lisp Time.
* enquque!: Queues.
@@ -10426,20 +11583,31 @@ Procedure and Macro Index
* factor: Prime Numbers.
* fft: Fast Fourier Transform.
* fft-1: Fast Fourier Transform.
+* fifth: SRFI-1. |
* file-exists?: Input/Output.
* filename:match-ci??: Filenames.
* filename:match??: Filenames.
* filename:substitute-ci??: Filenames.
* filename:substitute??: Filenames.
* fill-empty-parameters: Parameter lists.
+* find: SRFI-1. |
* find-if: Lists as sets.
+* find-ratio: Rationalize.
+* find-ratio-between: Rationalize.
* find-string-from-port?: String Search.
+* find-tail: SRFI-1. |
+* first: SRFI-1. |
* fluid-let: Fluid-Let.
* for-each-elt: Collections.
* for-each-key <1>: Collections.
* for-each-key: Base Table.
* for-each-row: Table Operations.
* force-output: Input/Output.
+* form:delimited: HTML.
+* form:element: HTML.
+* form:image: HTML.
+* form:reset: HTML.
+* form:submit: HTML.
* format: Format Interface.
* fprintf: Standard Formatted Output.
* fscanf: Standard Formatted Input.
@@ -10459,6 +11627,7 @@ Procedure and Macro Index
* glob-pattern?: System Interface.
* gmktime: Posix Time.
* gmtime: Posix Time.
+* golden-section-search: Minimizing.
* gtime: Posix Time.
* has-duplicates?: Lists as sets.
* hash: Hashing.
@@ -10473,18 +11642,37 @@ Procedure and Macro Index
* heap-insert!: Priority Queues.
* heap-length: Priority Queues.
* home-vicinity: Vicinity.
-* html:comment: HTML HTTP and CGI.
-* html:end-form: HTML HTTP and CGI.
-* html:end-page: HTML HTTP and CGI.
-* html:end-table: HTML HTTP and CGI.
-* html:heading: HTML HTTP and CGI.
-* html:href-heading: HTML HTTP and CGI.
-* html:pre: HTML HTTP and CGI.
-* html:start-form: HTML HTTP and CGI.
-* html:start-page: HTML HTTP and CGI.
-* html:start-table: HTML HTTP and CGI.
-* http:read-request-line: HTML HTTP and CGI.
-* http:serve-query: HTML HTTP and CGI.
+* html:anchor: URI.
+* html:atval: HTML.
+* html:base: URI.
+* html:body: HTML.
+* html:buttons: HTML.
+* html:caption: HTML Tables.
+* html:checkbox: HTML.
+* html:comment: HTML.
+* html:editable-row-converter: HTML Tables.
+* html:form: HTML.
+* html:head: HTML.
+* html:heading: HTML Tables.
+* html:hidden: HTML.
+* html:href-heading: HTML Tables.
+* html:http-equiv: HTML.
+* html:isindex: URI.
+* html:link: URI.
+* html:linked-row-converter: HTML Tables.
+* html:meta: HTML.
+* html:meta-refresh: HTML.
+* html:plain: HTML.
+* html:pre: HTML.
+* html:select: HTML.
+* html:table: HTML Tables.
+* html:text: HTML.
+* html:text-area: HTML.
+* http:content: HTTP and CGI.
+* http:error-page: HTTP and CGI.
+* http:forwarding-page: HTTP and CGI.
+* http:header: HTTP and CGI.
+* http:serve-query: HTTP and CGI.
* identifier=?: Syntactic Closures.
* identifier?: Syntactic Closures.
* identity: Legacy.
@@ -10496,19 +11684,26 @@ Procedure and Macro Index
* integer-sqrt: Root Finding.
* interaction-environment: Eval.
* intersection: Lists as sets.
+* iota: SRFI-1. |
* jacobi-symbol: Prime Numbers.
* kill-process!: Multi-Processing.
* kill-table: Base Table.
* laguerre:find-polynomial-root: Root Finding.
* laguerre:find-root: Root Finding.
+* last <1>: SRFI-1. |
* last: Lists as sequences.
* last-pair: Legacy.
+* length+: SRFI-1. |
* library-vicinity: Vicinity.
* list*: List construction.
* list->bytes: Byte.
* list->string: Rev4 Optional Procedures.
* list->vector: Rev4 Optional Procedures.
+* list-of??: Lists as sets.
+* list-table-definition: Database Utilities.
+* list-tabulate: SRFI-1. |
* list-tail: Rev4 Optional Procedures.
+* list=: SRFI-1. |
* load-option: Weight-Balanced Trees.
* localtime: Posix Time.
* logand: Bit-Twiddling.
@@ -10534,10 +11729,8 @@ Procedure and Macro Index
* macroexpand-1: Defmacro.
* macwork:eval: Macros That Work.
* macwork:expand: Macros That Work.
-* macwork:load: Macros That Work.
-* make-: Structures.
+* macwork:load: Macros That Work. |
* make-array: Arrays.
-* make-atval: HTML HTTP and CGI.
* make-base: Base Table.
* make-bytes: Byte.
* make-command-server: Database Utilities.
@@ -10556,27 +11749,28 @@ Procedure and Macro Index
* make-method!: Object.
* make-object: Object.
* make-parameter-list: Parameter lists.
-* make-plain: HTML HTTP and CGI.
* make-port-crc: Cyclic Checksum.
* make-predicate!: Object.
* make-promise: Promises.
* make-putter: Base Table.
+* make-query-alist-command-server: HTTP and CGI.
* make-queue: Queues.
* make-random-state: Random Numbers.
* make-record-type: Records.
* make-relational-system: Creating and Opening Relational Databases.
-* make-row-converter: HTML HTTP and CGI.
* make-ruleset: Commutative Rings.
* make-shared-array: Arrays.
* make-sierpinski-indexer: Hashing.
* make-syntactic-closure: Syntactic Closures.
* make-table: Base Table.
+* make-uri: URI.
* make-vicinity: Vicinity.
* make-wt-tree: Construction of Weight-Balanced Trees.
* make-wt-tree-type: Construction of Weight-Balanced Trees.
* map-elts: Collections.
* map-key: Base Table.
* map-keys: Collections.
+* member: SRFI-1. |
* member-if: Lists as sets.
* merge: Sorting.
* merge!: Sorting.
@@ -10595,12 +11789,15 @@ Procedure and Macro Index
* nconc: Destructive list operations.
* newton:find-root: Root Finding.
* newtown:find-integer-root: Root Finding.
+* ninth: SRFI-1. |
+* not-pair?: SRFI-1. |
* notany: Lists as sets.
* notevery: Lists as sets.
* nreverse: Destructive list operations.
* nthcdr: Lists as sequences.
* null-directory?: System Interface.
* null-environment: Eval.
+* null-list?: SRFI-1. |
* object: Yasos interface.
* object->limited-string: Object-To-String.
* object->string: Object-To-String.
@@ -10623,8 +11820,12 @@ Procedure and Macro Index
* parameter-list-expand: Parameter lists.
* parameter-list-ref: Parameter lists.
* parse-ftp-address: System Interface.
-* path->url: System Interface.
+* path->uri: System Interface.
* plot!: Plotting.
+* plot-function!: Plotting.
+* pnm:array-write: Portable Image Files.
+* pnm:image-file->array: Portable Image Files.
+* pnm:type-dimensions: Portable Image Files.
* position: Lists as sequences.
* pprint-file: Pretty-Print.
* pprint-filter-file: Pretty-Print.
@@ -10647,14 +11848,17 @@ Procedure and Macro Index
* predicate->hash-asso: Hash Tables.
* present?: Base Table.
* pretty-print: Pretty-Print.
+* pretty-print->string: Pretty-Print.
* prime?: Prime Numbers.
* primes<: Prime Numbers.
* primes>: Prime Numbers.
* print: Yasos interface.
+* print-call-stack: Trace.
* printf: Standard Formatted Output.
* process:schedule!: Multi-Processing.
* program-vicinity: Vicinity.
* project-table: Relational Database Operations.
+* proper-list?: SRFI-1. |
* provide <1>: Require.
* provide: Feature.
* provided? <1>: Require.
@@ -10692,6 +11896,7 @@ Procedure and Macro Index
* remove-duplicates: Lists as sets.
* remove-if: Lists as sets.
* remove-if-not: Lists as sets.
+* remove-parameter: Parameter lists.
* remove-setter-for: Setters.
* repl:quit: Repl.
* repl:top-level: Repl.
@@ -10702,6 +11907,7 @@ Procedure and Macro Index
* require:feature->path <1>: Require.
* require:feature->path: Requesting Features.
* restrict-table: Relational Database Operations.
+* reverse!: SRFI-1. |
* row:delete: Table Operations.
* row:delete*: Table Operations.
* row:insert: Table Operations.
@@ -10719,13 +11925,14 @@ Procedure and Macro Index
* secant:find-bracketed-root: Root Finding.
* secant:find-root: Root Finding.
* seed->random-state: Random Numbers.
-* serve-urlencoded-command: HTML HTTP and CGI.
-* set: Setters.
-* set-: Structures.
+* set: Setters. |
* set-difference: Lists as sets.
* Setter: Collections.
* setter: Setters.
+* seventh: SRFI-1. |
+* si:conversion-factor: Metric Units.
* singleton-wt-tree: Construction of Weight-Balanced Trees.
+* sixth: SRFI-1. |
* size <1>: Collections.
* size: Yasos interface.
* slib:error: System.
@@ -10744,8 +11951,11 @@ Procedure and Macro Index
* sort!: Sorting.
* sorted?: Sorting.
* soundex: Hashing.
+* split-at: SRFI-1. |
* sprintf: Standard Formatted Output.
* sscanf: Standard Formatted Input.
+* stack: Trace.
+* stack-all: Debug.
* string->list: Rev4 Optional Procedures.
* string-capitalize: String-Case.
* string-captialize!: String-Case.
@@ -10774,8 +11984,10 @@ Procedure and Macro Index
* substv: Tree Operations.
* supported-key-type?: Base Table.
* supported-type?: Base Table.
+* symbol-append: String-Case.
* symmetric:modulus: Modular Arithmetic.
* sync-base: Base Table.
+* sync-database: Relational Database Operations.
* syncase:eval: Syntax-Case Macros.
* syncase:expand: Syntax-Case Macros.
* syncase:load: Syntax-Case Macros.
@@ -10784,11 +11996,12 @@ Procedure and Macro Index
* synclo:load: Syntactic Closures.
* syntax-rules: Macro by Example.
* system: System Interface.
-* table->html: HTML HTTP and CGI.
-* table->page: HTML HTTP and CGI.
+* table->linked-html: HTML Tables.
+* table->linked-page: HTML Tables.
* table-exists?: Relational Database Operations.
-* table-name->filename: HTML HTTP and CGI.
-* TAG: Structures.
+* table-name->filename: HTML Tables.
+* take: SRFI-1. |
+* take-right: SRFI-1. |
* tek40:draw: Tektronix Graphics Support.
* tek40:graphics: Tektronix Graphics Support.
* tek40:init: Tektronix Graphics Support.
@@ -10805,6 +12018,7 @@ Procedure and Macro Index
* tek41:move: Tektronix Graphics Support.
* tek41:point: Tektronix Graphics Support.
* tek41:reset: Tektronix Graphics Support.
+* tenth: SRFI-1. |
* time-zone: Time Zone.
* tmpnam: Input/Output.
* tok:char-group: Token definition.
@@ -10812,6 +12026,8 @@ Procedure and Macro Index
* trace: Trace.
* trace-all: Debug.
* tracef: Trace.
+* track: Trace.
+* track-all: Debug.
* transcript-off: Transcripts.
* transcript-on: Transcripts.
* transformer: Syntactic Closures.
@@ -10820,19 +12036,28 @@ Procedure and Macro Index
* two-arg:-: Multi-argument / and -.
* two-arg:/: Multi-argument / and -.
* two-arg:apply: Multi-argument Apply.
-* type-of: Non-List functions.
+* type-of: Type Coercion.
* tz:params: Time Zone.
* tzset: Time Zone.
* unbreak: Breakpoints.
* unbreakf: Breakpoints.
* union: Lists as sets.
* unmake-method!: Object.
+* unstack: Trace.
* untrace: Trace.
* untracef: Trace.
+* untrack: Trace.
+* unzip1: SRFI-1. |
+* unzip2: SRFI-1. |
+* unzip3: SRFI-1. |
+* unzip4: SRFI-1. |
+* unzip5: SRFI-1. |
+* uri->tree: URI.
+* uric:decode: URI.
+* uric:encode: URI.
* user-email-address: System Interface.
* user-vicinity: Vicinity.
-* values: Values.
-* variant-case: Structures.
+* values: Values. |
* vector->list: Rev4 Optional Procedures.
* vector-fill!: Rev4 Optional Procedures.
* with-input-from-file: With-File.
@@ -10868,6 +12093,8 @@ Procedure and Macro Index
* wt-tree/subset?: Advanced Operations on Weight-Balanced Trees.
* wt-tree/union: Advanced Operations on Weight-Balanced Trees.
* wt-tree?: Basic Operations on Weight-Balanced Trees.
+* xcons: SRFI-1. |
+* zip: SRFI-1. |
Variable Index
**************
@@ -10878,7 +12105,7 @@ Variable Index
* *catalog*: Require.
* *features*: Require.
-* *html:output-port*: HTML HTTP and CGI.
+* *http:byline*: HTTP and CGI.
* *modules*: Require.
* *optarg*: Getopt.
* *optind*: Getopt.
@@ -10898,6 +12125,7 @@ Variable Index
* column-names: Table Operations.
* column-types: Table Operations.
* daylight?: Time Zone.
+* debug:max-count: Trace.
* distribute*: Commutative Rings.
* distribute/: Commutative Rings.
* most-positive-fixnum: Configuration.
@@ -10930,8 +12158,9 @@ Concept and Feature Index
* ange-ftp: System Interface.
* array: Arrays.
* array-for-each: Array Mapping.
-* attribute-value: HTML HTTP and CGI.
+* attribute-value: HTML.
* balanced binary trees: Weight-Balanced Trees.
+* base: URI.
* batch: Batch.
* binary trees: Weight-Balanced Trees.
* binary trees, as discrete maps: Weight-Balanced Trees.
@@ -10945,8 +12174,10 @@ Concept and Feature Index
* careful: Commutative Rings.
* catalog: Requesting Features.
* Catalog File: Library Catalogs.
+* cgi: HTTP and CGI. |
* chapter-order: Chapter Ordering.
* charplot: Plotting.
+* coerce: Type Coercion.
* collect: Collections.
* command line: Command Line.
* commentfix: Precedence Parsing Overview.
@@ -10961,9 +12192,12 @@ Concept and Feature Index
* defmacroexpand <1>: Pretty-Print.
* defmacroexpand: Defmacro.
* delim: Precedence Parsing Overview.
+* diff: Sequence Comparison. |
* discrete maps, using binary trees: Weight-Balanced Trees.
+* DrScheme: Installation.
* dynamic: Dynamic Data Type.
* dynamic-wind: Dynamic-Wind.
+* escaped: URI.
* Euclidean Domain: Commutative Rings.
* factor: Prime Numbers.
* feature <1>: About this manual.
@@ -10972,7 +12206,7 @@ Concept and Feature Index
* fft: Fast Fourier Transform.
* fluid-let <1>: Database Utilities.
* fluid-let: Fluid-Let.
-* form: HTML HTTP and CGI.
+* form: HTML.
* format: Format.
* generic-write: Generic-Write.
* getit: System Interface.
@@ -10980,16 +12214,20 @@ Concept and Feature Index
* getopt: Getopt.
* glob <1>: Batch.
* glob: Filenames.
+* Guile: Installation. |
* hash: Hashing.
* hash-table: Hash Tables.
* HOME <1>: Vicinity.
* HOME: Library Catalogs.
* homecat: Catalog Compilation.
+* html-form: HTML. |
+* http: HTTP and CGI. |
* implcat: Catalog Compilation.
* infix: Precedence Parsing Overview.
* inmatchfix: Precedence Parsing Overview.
* Left Denotation, led: Nud and Led Definition.
* line-i: Line I/O.
+* list-processing library: SRFI-1. |
* logical: Bit-Twiddling.
* macro <1>: Repl.
* macro: R4RS Macros.
@@ -10997,33 +12235,40 @@ Concept and Feature Index
* macros-that-work: Macros That Work.
* make-crc: Cyclic Checksum.
* match: Base Table.
-* match-key: Base Table.
-* match-keys: Table Operations.
+* match-keys <1>: Table Operations.
+* match-keys: Base Table.
* matchfix: Precedence Parsing Overview.
+* metric-units: Metric Units.
+* minimize: Minimizing.
* minimum field width (printf): Standard Formatted Output.
+* MIT Scheme: Installation. |
* mkimpcat.scm: Catalog Compilation.
* mklibcat.scm: Catalog Compilation.
* modular: Modular Arithmetic.
* multiarg-apply: Multi-argument Apply.
* mutliarg: Multi-argument / and -.
+* MzScheme: Installation.
* nary: Precedence Parsing Overview.
* net-clients: System Interface.
+* new-catalog: Catalog Compilation.
* nofix: Precedence Parsing Overview.
+* null: HTML Tables.
* Null Denotation, nud: Nud and Led Definition.
* object: Object.
* object->string: Object-To-String.
* oop: Yasos.
* option, run-time-loadable: Weight-Balanced Trees.
-* options file: Command Line. |
+* options file: Command Line.
* parameters <1>: Database Utilities.
* parameters <2>: Batch.
* parameters: Parameter lists.
* parse: Precedence Parsing.
-* plain-text: HTML HTTP and CGI.
+* plain-text: HTML.
+* PLT Scheme: Installation.
* posix-time: Posix Time.
* postfix: Precedence Parsing Overview.
* pprint-file: Pretty-Print.
-* PRE: HTML HTTP and CGI.
+* PRE: HTML.
* precedence: Precedence Parsing.
* precision (printf): Standard Formatted Output.
* prefix: Precedence Parsing Overview.
@@ -11037,7 +12282,7 @@ Concept and Feature Index
* promise: Promises.
* qp <1>: Quick Print.
* qp: Getopt.
-* query-string: HTML HTTP and CGI.
+* query-string: HTTP and CGI.
* queue: Queues.
* random: Random Numbers.
* rationalize: Rationalize.
@@ -11046,27 +12291,37 @@ Concept and Feature Index
* relational-database: Relational Database.
* repl <1>: Repl.
* repl: Syntax-Case Macros.
+* reset: HTML.
* rev2-procedures: Rev2 Procedures.
-* rev3-report: Coding Standards.
+* rev3-report: Coding Guidelines.
* rev4-optional-procedures: Rev4 Optional Procedures.
* ring, commutative: Commutative Rings.
* RNG: Random Numbers.
* root: Root Finding.
* run-time-loadable option: Weight-Balanced Trees.
-* scanf: Standard Formatted Input. |
+* scanf: Standard Formatted Input.
+* Scheme Request For Implementation: SRFI. |
+* Scheme48: Installation.
* schmooz: Schmooz.
+* SCM: Installation.
+* self-set: Commutative Rings. |
+* Sequence Comparison: Sequence Comparison. |
+* Server-based Naming Authority: URI.
* session: Feature.
* sets, using binary trees: Weight-Balanced Trees.
* sierpinski: Hashing.
-* sitecat: Catalog Compilation. |
+* sitecat: Catalog Compilation.
* slibcat: Catalog Compilation.
* sort: Sorting.
* soundex: Hashing.
+* spiff: Sequence Comparison. |
+* srfi: SRFI. |
+* SRFI-1: SRFI-1. |
+* srfi-1: SRFI-1. |
* stdio: Standard Formatted I/O.
* string-case: String-Case.
* string-port: String Ports.
-* string-search: String Search.
-* struct: Structures.
+* string-search: String Search. |
* syntactic-closures: Syntactic Closures.
* syntax-case: Syntax-Case Macros.
* time: Time and Date.
@@ -11078,11 +12333,16 @@ Concept and Feature Index
* trees, balanced binary: Weight-Balanced Trees.
* tsort: Topological Sort.
* TZ-string: Time Zone.
+* Uniform Resource Identifiers: URI.
* Uniform Resource Locator: System Interface.
* Unique Factorization: Commutative Rings.
+* unsafe: URI.
+* uri: URI. |
+* URI: HTTP and CGI.
* usercat: Catalog Compilation.
* UTC: Posix Time.
* values: Values.
+* VSCM: Installation.
* weight-balanced binary trees: Weight-Balanced Trees.
* wild-card: Base Table.
* with-file: With-File.
@@ -11092,149 +12352,162 @@ Concept and Feature Index

Tag Table:
-Node: Top1057
-Node: The Library System1870
-Node: Feature2184
-Node: Requesting Features3134
-Node: Library Catalogs4493
-Node: Catalog Compilation6945
-Node: Built-in Support9755
-Node: Require10386
-Node: Vicinity12879
-Node: Configuration15846
-Node: Input/Output18787
-Node: Legacy20386
-Node: System21228
-Node: About this manual23720
-Node: Scheme Syntax Extension Packages24277
-Node: Defmacro24962
-Node: R4RS Macros26912
-Node: Macro by Example28167
-Node: Macros That Work31043
-Node: Syntactic Closures37101
-Node: Syntax-Case Macros54534
-Node: Fluid-Let58661
-Node: Yasos59602
-Node: Yasos terms60395
-Node: Yasos interface61419
-Node: Setters63496
-Node: Yasos examples66138
-Node: Textual Conversion Packages69132
-Node: Precedence Parsing69708
-Node: Precedence Parsing Overview70371
-Node: Ruleset Definition and Use72572
-Node: Token definition74953
-Node: Nud and Led Definition77222
-Node: Grammar Rule Definition79671
-Node: Format87245
-Node: Format Interface87493
-Node: Format Specification89230
-Node: Standard Formatted I/O99287
-Node: Standard Formatted Output99853
-Node: Standard Formatted Input108913
-Node: Programs and Arguments115572
-Node: Getopt116085
-Node: Command Line121927
-Node: Parameter lists125116
-Node: Getopt Parameter lists128753
-Node: Filenames130948
-Node: Batch134178
-Node: HTML HTTP and CGI142791
-Node: Printing Scheme149960
-Node: Generic-Write150283
-Node: Object-To-String151686
-Node: Pretty-Print152090
-Node: Time and Date154036
-Node: Time Zone155063
-Node: Posix Time159625
-Node: Common-Lisp Time161761
-Node: Vector Graphics163340
-Node: Tektronix Graphics Support163529
-Node: Schmooz164903
-Node: Mathematical Packages169129
-Node: Bit-Twiddling169721
-Node: Modular Arithmetic174312
-Node: Prime Numbers176446
-Node: Random Numbers178453
-Node: Fast Fourier Transform183166
-Node: Cyclic Checksum184084
-Node: Plotting185802
-Node: Root Finding188377
-Node: Commutative Rings192371
-Node: Determinant203757
-Node: Database Packages204055
-Node: Base Table204319
-Node: Relational Database214477
-Node: Motivations215261
-Node: Creating and Opening Relational Databases220308
-Node: Relational Database Operations222740
-Node: Table Operations225537
-Node: Catalog Representation233415
-Node: Unresolved Issues236313
-Node: Database Utilities239264
-Node: Database Reports254919
-Node: Database Browser257674
-Node: Weight-Balanced Trees258735
-Node: Construction of Weight-Balanced Trees262605
-Node: Basic Operations on Weight-Balanced Trees266055
-Node: Advanced Operations on Weight-Balanced Trees269020
-Node: Indexing Operations on Weight-Balanced Trees275042
-Node: Other Packages278956
-Node: Data Structures279355
-Node: Arrays280074
-Node: Array Mapping283028
-Node: Association Lists284945
-Node: Byte287196
-Node: Collections289427
-Node: Dynamic Data Type295534
-Node: Hash Tables296795
-Node: Hashing298912
-Node: Object303687
-Node: Priority Queues311924
-Node: Queues312767
-Node: Records313893
-Node: Structures317404
-Node: Procedures318704
-Node: Common List Functions319391
-Node: List construction319815
-Node: Lists as sets321478
-Node: Lists as sequences326850
-Node: Destructive list operations332096
-Node: Non-List functions334760
-Node: Tree Operations336108
-Node: Chapter Ordering337654
-Node: Sorting339274
-Node: Topological Sort345051
-Node: String-Case346738
-Node: String Ports347359
-Node: String Search348123
-Node: Line I/O350490
-Node: Multi-Processing352139
-Node: Standards Support353223
-Node: With-File353878
-Node: Transcripts354154
-Node: Rev2 Procedures354475
-Node: Rev4 Optional Procedures356182
-Node: Multi-argument / and -356752
-Node: Multi-argument Apply357403
-Node: Rationalize357889
-Node: Promises358552
-Node: Dynamic-Wind358969
-Node: Eval360223
-Node: Values363560
-Node: Session Support364347
-Node: Repl364815
-Node: Quick Print366098
-Node: Debug367211
-Node: Breakpoints367853
-Node: Trace370071
-Node: System Interface371445
-Node: Extra-SLIB Packages375246
-Node: About SLIB377378
-Node: Installation378462
-Node: Porting380312
-Node: Coding Standards381829
-Node: Copyrights383908
-Node: Index387192
+Node: Top1026
+Node: The Library System1740
+Node: Feature2054
+Node: Requesting Features3004
+Node: Library Catalogs4363
+Node: Catalog Compilation6815
+Node: Built-in Support9624
+Node: Require10255
+Node: Vicinity12747
+Node: Configuration15714
+Node: Input/Output18655
+Node: Legacy20254
+Node: System21096
+Node: About this manual23588
+Node: Scheme Syntax Extension Packages24145
+Node: Defmacro24837
+Node: R4RS Macros26788
+Node: Macro by Example28043
+Node: Macros That Work30922
+Node: Syntactic Closures36980
+Node: Syntax-Case Macros54414
+Node: Fluid-Let58605
+Node: Yasos59546
+Node: Yasos terms60339
+Node: Yasos interface61363
+Node: Setters63438
+Node: Yasos examples66079
+Node: Textual Conversion Packages69073
+Node: Precedence Parsing69751
+Node: Precedence Parsing Overview70414
+Ref: Precedence Parsing Overview-Footnote-172337
+Node: Ruleset Definition and Use72615
+Node: Token definition74996
+Node: Nud and Led Definition77265
+Node: Grammar Rule Definition79714
+Node: Format87288
+Node: Format Interface87536
+Node: Format Specification89273
+Node: Standard Formatted I/O99328
+Node: Standard Formatted Output99894
+Node: Standard Formatted Input109617
+Node: Programs and Arguments116277
+Node: Getopt116777
+Node: Command Line122619
+Node: Parameter lists125808
+Node: Getopt Parameter lists129695
+Node: Filenames132950
+Node: Batch136180
+Node: HTML143973
+Node: HTML Tables150074
+Node: HTTP and CGI156483
+Node: URI161013
+Node: Printing Scheme163686
+Node: Generic-Write163995
+Node: Object-To-String165398
+Node: Pretty-Print165802
+Node: Time and Date168765
+Node: Time Zone169792
+Node: Posix Time174353
+Node: Common-Lisp Time176489
+Node: Vector Graphics178068
+Node: Tektronix Graphics Support178257
+Node: Schmooz179631
+Node: Mathematical Packages183857
+Node: Bit-Twiddling184491
+Node: Modular Arithmetic189082
+Node: Prime Numbers191216
+Node: Random Numbers192899
+Node: Fast Fourier Transform197535
+Node: Cyclic Checksum198453
+Node: Plotting200417
+Node: Root Finding203276
+Node: Minimizing207263
+Ref: Minimizing-Footnote-1208700
+Node: Commutative Rings209303
+Node: Determinant220687
+Node: Database Packages221092
+Node: Base Table221356
+Node: Relational Database231770
+Node: Motivations232554
+Node: Creating and Opening Relational Databases237601
+Node: Relational Database Operations240033
+Node: Table Operations243029
+Node: Catalog Representation250907
+Node: Unresolved Issues253805
+Node: Database Utilities256756
+Node: Database Reports272873
+Node: Database Browser275627
+Node: Weight-Balanced Trees276688
+Node: Construction of Weight-Balanced Trees280559
+Node: Basic Operations on Weight-Balanced Trees284009
+Node: Advanced Operations on Weight-Balanced Trees286974
+Node: Indexing Operations on Weight-Balanced Trees292996
+Node: Other Packages296910
+Node: Data Structures297389
+Node: Arrays298223
+Node: Array Mapping302100
+Node: Association Lists304017
+Node: Byte306268
+Node: Portable Image Files308508
+Node: Collections310055
+Node: Dynamic Data Type316447
+Node: Hash Tables317708
+Node: Hashing319889
+Node: Object324660
+Node: Priority Queues332896
+Node: Queues333739
+Node: Records334865
+Node: Sorting and Searching338436
+Node: Common List Functions339236
+Node: List construction339761
+Node: Lists as sets341607
+Node: Lists as sequences348573
+Node: Destructive list operations353827
+Node: Non-List functions356490
+Node: Tree Operations357667
+Node: Chapter Ordering359507
+Node: Sorting361217
+Node: Topological Sort367084
+Node: String Search368863
+Node: Sequence Comparison371335
+Node: Procedures377271
+Node: Type Coercion378665
+Node: String-Case379881
+Node: String Ports382059
+Node: Line I/O383592
+Node: Multi-Processing385320
+Node: Metric Units386424
+Node: Standards Support394650
+Node: With-File395385
+Node: Transcripts395661
+Node: Rev2 Procedures395982
+Node: Rev4 Optional Procedures397739
+Node: Multi-argument / and -398309
+Node: Multi-argument Apply399048
+Node: Rationalize399583
+Node: Promises400908
+Node: Dynamic-Wind401325
+Node: Eval402579
+Node: Values405916
+Node: SRFI406795
+Node: SRFI-1409905
+Node: Session Support420362
+Node: Repl420909
+Node: Quick Print422192
+Node: Debug423305
+Node: Breakpoints424191
+Node: Trace426214
+Node: System Interface429325
+Node: Extra-SLIB Packages433079
+Node: About SLIB435381
+Node: Installation436084
+Node: Porting443977
+Ref: Porting-Footnote-1421798
+Node: Coding Guidelines445504
+Node: Copyrights447585
+Node: Index450931

End Tag Table