diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:31 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:31 -0800 |
commit | 5145dd3aa0c02c9fc496d1432fc4410674206e1d (patch) | |
tree | 540afc30c51da085f5bd8ec3f4c89f6496e7900d /slib.info | |
parent | 8466d8cfa486fb30d1755c4261b781135083787b (diff) | |
download | slib-5145dd3aa0c02c9fc496d1432fc4410674206e1d.tar.gz slib-5145dd3aa0c02c9fc496d1432fc4410674206e1d.zip |
Import Upstream version 3a2upstream/3a2
Diffstat (limited to 'slib.info')
-rw-r--r-- | slib.info | 13110 |
1 files changed, 7185 insertions, 5925 deletions
@@ -1,4 +1,4 @@ -This is slib.info, produced by makeinfo version 4.6 from slib.texi. +This is slib.info, produced by makeinfo version 4.7 from slib.texi. | INFO-DIR-SECTION The Algorithmic Language Scheme START-INFO-DIR-ENTRY @@ -38,7 +38,7 @@ implementation, user, or directory. * Menu: * The Library System:: How to use and customize. -* Universal SLIB Procedures:: Provided for all implementations. | +* Universal SLIB Procedures:: Provided for all implementations. * Scheme Syntax Extension Packages:: * Textual Conversion Packages:: * Mathematical Packages:: @@ -49,31 +49,31 @@ implementation, user, or directory. File: slib.info, Node: The Library System, Next: Universal SLIB Procedures, Prev: Top, Up: Top - | -The Library System -****************** + +1 The Library System | +******************** | * Menu: * Feature:: SLIB names. -* Require:: | +* Require:: * Library Catalogs:: -* Catalog Creation:: | -* Catalog Vicinities:: | -* Compiling Scheme:: | +* Catalog Creation:: +* Catalog Vicinities:: +* Compiling Scheme:: File: slib.info, Node: Feature, Next: Require, Prev: The Library System, Up: The Library System - | -Feature -======= + +1.1 Feature | +=========== | SLIB denotes "features" by symbols. SLIB maintains a list of features -supported by a Scheme "session". The set of features provided by a | -session may change during that session. Some features are properties | -of the Scheme implementation being used. The following "intrinsic | -feature"s detail what sort of numbers are available from an | -implementation: | +supported by a Scheme "session". The set of features provided by a +session may change during that session. Some features are properties +of the Scheme implementation being used. The following "intrinsic +feature"s detail what sort of numbers are available from an +implementation: * 'inexact @@ -85,63 +85,72 @@ implementation: | * 'bignum -SLIB initialization (in `require.scm') tests and "provide"s any of | -these numeric features which are appropriate. | - | -Other features correspond to the presence of packages of Scheme | -procedures or syntax (macros). | +SLIB initialization (in `require.scm') tests and "provide"s any of +these numeric features which are appropriate. - - Function: provided? feature - Returns `#t' if FEATURE is present in the current Scheme session; | - otherwise `#f'. More specifically, `provided?' returns `#t' if | - the symbol FEATURE is the `software-type' or if FEATURE has been | - provided by a module already loaded; and `#f' otherwise. | - | - In some implementations `provided?' tests whether a module has | - been `require'd by any module or in any thread; other | - implementations will have `provided?' reflect only the modules | - `require'd by that particular session or thread. | - | - To work portably in both scenarios, use `provided?' only to test | - whether intrinsic properties (like those above) are present. | - | - The FEATURE argument can also be an expression calling `and', | - `or', and `not' of features. The boolean result of the logical | - question asked by FEATURE is returned. | - | -The generalization of `provided?' for arbitrary features and catalog is | -`feature-eval': | - | - - Function: feature-eval expression provided? | - Evaluates `and', `or', and `not' forms in EXPRESSION, using the | - values returned by calling PROVIDED? on the leaf symbols. | - `feature-eval' returns the boolean result of the logical | - combinations. | +Other features correspond to the presence of packages of Scheme +procedures or syntax (macros). + + -- Function: provided? feature | + Returns `#t' if FEATURE is present in the current Scheme session; + otherwise `#f'. More specifically, `provided?' returns `#t' if + the symbol FEATURE is the `software-type', the | + `scheme-implementation-type' (1), or if FEATURE has been provided | + by a module already loaded; and `#f' otherwise. | + + In some implementations `provided?' tests whether a module has + been `require'd by any module or in any thread; other + implementations will have `provided?' reflect only the modules + `require'd by that particular session or thread. + + To work portably in both scenarios, use `provided?' only to test + whether intrinsic properties (like those above) are present. - - Procedure: provide feature - Informs SLIB that FEATURE is supported in this session. | + The FEATURE argument can also be an expression calling `and', + `or', and `not' of features. The boolean result of the logical + question asked by FEATURE is returned. + +The generalization of `provided?' for arbitrary features and catalog is +`feature-eval': + + -- Function: feature-eval expression provided? | + Evaluates `and', `or', and `not' forms in EXPRESSION, using the + values returned by calling PROVIDED? on the leaf symbols. + `feature-eval' returns the boolean result of the logical + combinations. + + -- Procedure: provide feature | + Informs SLIB that FEATURE is supported in this session. (provided? 'foo) => #f (provide 'foo) (provided? 'foo) => #t + ---------- Footnotes ---------- | + | + (1) scheme-implementation-type is the name symbol of the running | +Scheme implementation (RScheme, |STk|, Bigloo, chez, Elk, gambit, | +guile, JScheme, MacScheme, MITScheme, Pocket-Scheme, Scheme48, | +Scheme->C, Scheme48, Scsh, T, umb-scheme, or Vscm). Dependence on | +scheme-implementation-type is almost always the wrong way to do things. | + | File: slib.info, Node: Require, Next: Library Catalogs, Prev: Feature, Up: The Library System - | -Require | -======= | + +1.2 Require | +=========== | SLIB creates and maintains a "catalog" mapping features to locations of files introducing procedures and syntax denoted by those features. - - Variable: *catalog* | - Is an association list of features (symbols) and pathnames which | - will supply those features. The pathname can be either a string | - or a pair. If pathname is a pair then the first element should be | - a macro feature symbol, `source', `compiled', or one of the other | - cases described in *Note Library Catalogs::. The cdr of the | - pathname should be either a string or a list. | - | + -- Variable: *catalog* | + Is an association list of features (symbols) and pathnames which + will supply those features. The pathname can be either a string + or a pair. If pathname is a pair then the first element should be + a macro feature symbol, `source', `compiled', or one of the other + cases described in *Note Library Catalogs::. The cdr of the + pathname should be either a string or a list. + At the beginning of each section of this manual, there is a line like `(require 'FEATURE)'. The Scheme files comprising SLIB are cataloged so that these feature names map to the corresponding files. @@ -149,56 +158,49 @@ 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 - * If `(provided? FEATURE)' is true, then `require' just returns. | + -- Procedure: require feature | + * If `(provided? FEATURE)' is true, then `require' just returns. * Otherwise, if FEATURE is found in the catalog, then the - corresponding files will be loaded and `(provided? FEATURE)' | - will henceforth return `#t'. That FEATURE is thereafter | - `provided'. | + corresponding files will be loaded and `(provided? FEATURE)' + will henceforth return `#t'. That FEATURE is thereafter + `provided'. * Otherwise (FEATURE not found in the catalog), an error is signaled. -There is a related form `require-if', used primarily for enabling | -compilers to statically include modules which would be dynamically | -loaded by interpreters. | - - - Procedure: require-if condition feature | - Requires FEATURE if CONDITION is true. | - -The `random' module uses `require-if' to flag `object->string' as a | -(dynamic) required module. | - - (require 'byte) | - (require 'logical) | - (require-if 'compiling 'object->string) | +There is a related form `require-if', used primarily for enabling +compilers to statically include modules which would be dynamically +loaded by interpreters. -The `batch' module uses `require-if' to flag `posix-time' as a module | -to load if the implementation supports large precision exact integers. | + -- Procedure: require-if condition feature | + Requires FEATURE if CONDITION is true. - (require-if '(and bignum compiling) 'posix-time) | +The `random' module uses `require-if' to flag `object->string' as a +(dynamic) required module. -The `commutative-ring' module uses `require-if' to ensure that it has | -an exponentiation routine, regardless of whether the implementation | -supports inexact numbers: | + (require 'byte) + (require 'logical) + (require-if 'compiling 'object->string) - (require-if '(not inexact) 'logical) ;for integer-expt | - (define number^ (if (provided? 'inexact) expt integer-expt)) | +The `batch' module uses `require-if' to flag `posix-time' as a module +to load if the implementation supports large precision exact integers. -The catalog can also be queried using `slib:in-catalog?'. | + (require-if '(and bignum compiling) 'posix-time) + | +The catalog can also be queried using `slib:in-catalog?'. - - Function: slib:in-catalog? feature | - Returns a `CDR' of the catalog entry if one was found for the | - symbol FEATURE in the alist `*catalog*' (and transitively through | - any symbol aliases encountered). Otherwise, returns `#f'. The | - format of catalog entries is explained in *Note Library Catalogs::. | + -- Function: slib:in-catalog? feature | + Returns a `CDR' of the catalog entry if one was found for the + symbol FEATURE in the alist `*catalog*' (and transitively through + any symbol aliases encountered). Otherwise, returns `#f'. The + format of catalog entries is explained in *Note Library Catalogs::. File: slib.info, Node: Library Catalogs, Next: Catalog Creation, Prev: Require, Up: The Library System - | -Library Catalogs | -================ | + +1.3 Library Catalogs | +==================== | Catalog files consist of one or more "association list"s. In the circumstance where a feature symbol appears in more than one list, the @@ -218,7 +220,7 @@ for elements of catalog lists: `slib:load-compiled's the files <path> .... `(FEATURE aggregate <symbol> ...)' - `slib:require's the features <symbol> .... | + `require's the features <symbol> .... | The various macro styles first `require' the named macro package, then just load <path> or load-and-macro-expand <path> as appropriate for the @@ -244,31 +246,31 @@ implementation. File: slib.info, Node: Catalog Creation, Next: Catalog Vicinities, Prev: Library Catalogs, Up: The Library System - | -Catalog Creation | -================ | -At the start of an interactive session no catalog is present, but is | -created with the first catalog inquiry (such as `(require 'random)'). | -Several sources of catalog information are combined to produce the | -catalog: | +1.4 Catalog Creation | +==================== | - * standard SLIB packages. | +At the start of an interactive session no catalog is present, but is +created with the first catalog inquiry (such as `(require 'random)'). +Several sources of catalog information are combined to produce the +catalog: - * additional packages of interest to this site. | - | - * packages specifically for the variety of Scheme which this session | - is running. | - | - * packages this user wants to always have available. This catalog | - is the file `homecat' in the user's "HOME" directory. | - | - * packages germane to working in this (current working) directory. | - This catalog is the file `usercat' in the directory to which it | - applies. One would typically `cd' to this directory before | - starting the Scheme session. | - | - * packages which are part of an application program. | + * standard SLIB packages. + + * additional packages of interest to this site. + + * packages specifically for the variety of Scheme which this session + is running. + + * packages this user wants to always have available. This catalog + is the file `homecat' in the user's "HOME" directory. + + * packages germane to working in this (current working) directory. + This catalog is the file `usercat' in the directory to which it + applies. One would typically `cd' to this directory before + starting the Scheme session. + + * packages which are part of an application program. SLIB combines the catalog information which doesn't vary per user into the file `slibcat' in the implementation-vicinity. Therefore `slibcat' @@ -279,34 +281,34 @@ is used with. The definition of `*SLIB-VERSION*' in SLIB file `require.scm' is checked against the catalog association of `*SLIB-VERSION*' to -ascertain when versions have changed. It is a reasonable practice to | -change the definition of `*SLIB-VERSION*' whenever the library is | -changed. If multiple implementations of Scheme use SLIB, remember that | -recompiling one `slibcat' will update only that implementation's | -catalog. | +ascertain when versions have changed. It is a reasonable practice to +change the definition of `*SLIB-VERSION*' whenever the library is +changed. If multiple implementations of Scheme use SLIB, remember that +recompiling one `slibcat' will update only that implementation's +catalog. The compilation scripts of Scheme implementations which work with SLIB can automatically trigger catalog compilation by deleting `slibcat' or -by invoking `require' of a special feature: | +by invoking `require' of a special feature: - - Procedure: require 'new-catalog + -- Procedure: require 'new-catalog | This will load `mklibcat', which compiles and writes a new `slibcat'. -Another special feature of `require' erases SLIB's catalog, forcing it | -to be reloaded the next time the catalog is queried. | +Another special feature of `require' erases SLIB's catalog, forcing it +to be reloaded the next time the catalog is queried. - - Procedure: require #f + -- Procedure: require #f | Removes SLIB's catalog information. This should be done before saving an executable image so that, when restored, its catalog will be loaded afresh. File: slib.info, Node: Catalog Vicinities, Next: Compiling Scheme, Prev: Catalog Creation, Up: The Library System - | -Catalog Vicinities | -================== | - | + +1.5 Catalog Vicinities | +====================== | + 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. @@ -339,381 +341,398 @@ the table override those of catalogs above it in the table. This file contains the associations specific to an SLIB user. `user-vicinity' `usercat' - This file contains associations affecting only those sessions whose | + This file contains associations affecting only those sessions whose "working directory" is `user-vicinity'. -Here is an example of a `usercat' catalog. A program in this directory | -can invoke the `run' feature with `(require 'run)'. | - | - ;;; "usercat": SLIB catalog additions for SIMSYNCH. -*-scheme-*- | - ( | - (simsynch . "../synch/simsynch.scm") | - (run . "../synch/run.scm") | - (schlep . "schlep.scm") | - ) | - | -Copying `usercat' to many directories is inconvenient. Application | -programs which aren't always run in specially prepared directories can | -nonetheless register their features during initialization. | - | - - Procedure: catalog:read vicinity catalog | - Reads file named by string CATALOG in VICINITY, resolving all | - paths relative to VICINITY, and adds those feature associations to | - *CATALOG*. | - | - `catalog:read' would typically be used by an application program | - having dynamically loadable modules. For instance, to register | - factoring and other modules in *CATALOG*, JACAL does: | - | - (catalog:read (program-vicinity) "jacalcat") | - | - | -For an application program there are three appropriate venues for | -registering its catalog associations: | - | - * in a `usercat' file in the directory where the program runs; or | - | - * in an `implcat' file in the `implementation-vicinity'; or | - | - * in an application program directory; loaded by calling | - `catalog:read'. | - | +Here is an example of a `usercat' catalog. A program in this directory +can invoke the `run' feature with `(require 'run)'. + + ;;; "usercat": SLIB catalog additions for SIMSYNCH. -*-scheme-*- + ( + (simsynch . "../synch/simsynch.scm") + (run . "../synch/run.scm") + (schlep . "schlep.scm") + ) + +Copying `usercat' to many directories is inconvenient. Application +programs which aren't always run in specially prepared directories can +nonetheless register their features during initialization. + + -- Procedure: catalog:read vicinity catalog | + Reads file named by string CATALOG in VICINITY, resolving all + paths relative to VICINITY, and adds those feature associations to + *CATALOG*. + + `catalog:read' would typically be used by an application program + having dynamically loadable modules. For instance, to register + factoring and other modules in *CATALOG*, JACAL does: + + (catalog:read (program-vicinity) "jacalcat") + + +For an application program there are three appropriate venues for +registering its catalog associations: + + * in a `usercat' file in the directory where the program runs; or + + * in an `implcat' file in the `implementation-vicinity'; or + + * in an application program directory; loaded by calling + `catalog:read'. + File: slib.info, Node: Compiling Scheme, Prev: Catalog Vicinities, Up: The Library System - | -Compiling Scheme | -================ -To use Scheme compilers effectively with SLIB the compiler needs to | -know which SLIB modules are to be compiled and which symbols are | -exported from those modules. | - | - The procedures in this section automate the extraction of this | -information from SLIB modules. They are guaranteed to work on SLIB | -modules; to use them on other sources, those sources should follow SLIB | -conventions. | +1.6 Compiling Scheme | +==================== | + +To use Scheme compilers effectively with SLIB the compiler needs to +know which SLIB modules are to be compiled and which symbols are +exported from those modules. + + The procedures in this section automate the extraction of this +information from SLIB modules. They are guaranteed to work on SLIB +modules; to use them on other sources, those sources should follow SLIB +conventions. * Menu: -* Module Conventions:: | -* Module Manifests:: | -* Module Semantics:: | -* Top-level Variable References:: | -* Module Analysis:: | +* Module Conventions:: +* Module Manifests:: +* Module Semantics:: +* Top-level Variable References:: +* Module Analysis:: File: slib.info, Node: Module Conventions, Next: Module Manifests, Prev: Compiling Scheme, Up: Compiling Scheme - | -Module Conventions | ------------------- | - * All the top-level `require' commands have one quoted argument and | - are positioned before other Scheme definitions and expressions in | - the file. | +1.6.1 Module Conventions | +------------------------ | - * Any conditionally `require'd SLIB modules (1) also appear at the | - beginning of their files conditioned on the feature `compiling' | - using `require-if' (*note require-if: Require.). | + * All the top-level `require' commands have one quoted argument and + are positioned before other Scheme definitions and expressions in + the file. - (require 'logical) | - (require 'multiarg/and-) | - (require-if 'compiling 'sort) | - (require-if 'compiling 'ciexyz) | + * Any conditionally `require'd SLIB modules (1) also appear at the + beginning of their files conditioned on the feature `compiling' + using `require-if' (*note require-if: Require.). - * Schmooz-style comments preceding a definition, identify that | - definition as an exported identifier (*note Schmooz::). For | - non-schmooz files, putting `;@' at the beginning of the line | - immediately preceding the definition (`define', `define-syntax', | - or `defmacro') suffices. | + (require 'logical) + (require 'multiarg/and-) + (require-if 'compiling 'sort) + (require-if 'compiling 'ciexyz) - ;@ | - (define (make-vicinity <pathname>) <pathname>) | + * Schmooz-style comments preceding a definition, identify that + definition as an exported identifier (*note Schmooz::). For + non-schmooz files, putting `;@' at the beginning of the line + immediately preceding the definition (`define', `define-syntax', + or `defmacro') suffices. - * Syntax (macro) definitions are grouped at the end of a module file. | + ;@ + (define (identity <obj>) <obj>) | - * Modules defining macros do not invoke those macros. SLIB macro | - implementations are exempt from this rule. | + * Syntax (macro) definitions are grouped at the end of a module file. - An example of how to expand macro invocations is: | + * Modules defining macros do not invoke those macros. SLIB macro + implementations are exempt from this rule. - (require 'macros-that-work) | - (require 'yasos) | - (require 'pprint-file) | - (pprint-filter-file "collect.scm" macwork:expand) | - | + An example of how to expand macro invocations is: + + (require 'macros-that-work) + (require 'yasos) + (require 'pprint-file) + (pprint-filter-file "collect.scm" macwork:expand) - ---------- Footnotes ---------- | - (1) There are some functions with internal `require' calls to delay | -loading modules until they are needed. While this reduces startup | -latency for interpreters, it can produce headaches for compilers. | + ---------- Footnotes ---------- + + (1) There are some functions with internal `require' calls to delay +loading modules until they are needed. While this reduces startup +latency for interpreters, it can produce headaches for compilers. File: slib.info, Node: Module Manifests, Next: Module Semantics, Prev: Module Conventions, Up: Compiling Scheme - | -Module Manifests | ----------------- | -`(require 'manifest)' | +1.6.2 Module Manifests | +---------------------- | -In some of these examples, SLIB:CATALOG is the SLIB part of the | -catalog; it is free of compiled and implementation-specific entries. | -It would be defined by: | - | - (define slib:catalog (cdr (member (assq 'null *catalog*) *catalog*))) | - | - - Function: file->requires file provided? catalog | - Returns a list of the features `require'd by FILE assuming the | - predicate PROVIDED? and association-list CATALOG. | - | - (define (provided+? . features) | - (lambda (feature) | - (or (memq feature features) (provided? feature)))) | - | - (file->requires "obj2str.scm" (provided+? 'compiling) '()) | - => (string-port generic-write) | - | - (file->requires "obj2str.scm" provided? '()) | - => (string-port) | - | - - Function: feature->requires feature provided? catalog | - Returns a list of the features `require'd by FEATURE assuming the | - predicate PROVIDED? and association-list CATALOG. | - | - (feature->requires 'batch (provided+? 'compiling) *catalog*) | - => (tree line-i/o databases parameters string-port | - pretty-print common-list-functions posix-time) | - | - (feature->requires 'batch provided? *catalog*) | - => (tree line-i/o databases parameters string-port | - pretty-print common-list-functions) | - | - (feature->requires 'batch provided? '((batch . "batch"))) | - => (tree line-i/o databases parameters string-port | - pretty-print common-list-functions) | - | - - Function: file->loads file | - Returns a list of strings naming existing files loaded (load | - slib:load slib:load-source macro:load defmacro:load syncase:load | - synclo:load macwork:load) by FILE or any of the files it loads. | - | - (file->loads (in-vicinity (library-vicinity) "scainit.scm")) | - => ("/usr/local/lib/slib/scaexpp.scm" | - "/usr/local/lib/slib/scaglob.scm" | - "/usr/local/lib/slib/scaoutp.scm") | - | - - Function: load->path exp | - Given a `(load '<expr>)', where <expr> is a string or vicinity | - stuff), `(load->path <expr>)' figures a path to the file. | - `load->path' returns that path if it names an existing file; | - otherwise #f. | - | - (load->path '(in-vicinity (library-vicinity) "mklibcat")) | - => "/usr/local/lib/slib/mklibcat.scm" | - | - - Function: file->definitions file | - Returns a list of the identifier symbols defined by SLIB (or | - SLIB-style) file FILE. | - | - (file->definitions "random.scm") | - => (*random-state* make-random-state | - seed->random-state copy-random-state random | - random:chunk) | - | - - Function: file->exports file | - Returns a list of the identifier symbols exported (advertised) by | - SLIB (or SLIB-style) file FILE. | - | - (file->exports "random.scm") | - => (make-random-state seed->random-state | - copy-random-state random) | - | - (file->exports "randinex.scm") | - => (random:solid-sphere! random:hollow-sphere! | - random:normal-vector! random:normal | - random:exp random:uniform) | - | - - Function: feature->export-alist feature catalog | - Returns a list of lists; each sublist holding the name of the file | - implementing FEATURE, and the identifier symbols exported | - (advertised) by SLIB (or SLIB-style) feature FEATURE, in CATALOG. | - | - - Function: feature->exports feature catalog | - Returns a list of all exports of FEATURE. | - | -In the case of `aggregate' features, more than one file may have export | -lists to report: | - | - (feature->export-alist 'r5rs slib:catalog)) | - => (("/usr/local/lib/slib/values.scm" | - call-with-values values) | - ("/usr/local/lib/slib/mbe.scm" | - define-syntax macro:expand | - macro:load macro:eval) | - ("/usr/local/lib/slib/eval.scm" | - eval scheme-report-environment | - null-environment interaction-environment)) | - | - (feature->export-alist 'stdio *catalog*) | - => (("/usr/local/lib/slib/scanf.scm" | - fscanf sscanf scanf scanf-read-list) | - ("/usr/local/lib/slib/printf.scm" | - sprintf printf fprintf) | - ("/usr/local/lib/slib/stdio.scm" | - stderr stdout stdin)) | - | - (feature->exports 'stdio slib:catalog) | - => (fscanf sscanf scanf scanf-read-list | - sprintf printf fprintf stderr stdout stdin) | +`(require 'manifest)' + +In some of these examples, SLIB:CATALOG is the SLIB part of the +catalog; it is free of compiled and implementation-specific entries. +It would be defined by: + + (define slib:catalog (cdr (member (assq 'null *catalog*) *catalog*))) + + -- Function: file->requires file provided? catalog | + Returns a list of the features `require'd by FILE assuming the + predicate PROVIDED? and association-list CATALOG. + + (define (provided+? . features) + (lambda (feature) + (or (memq feature features) (provided? feature)))) + + (file->requires "obj2str.scm" (provided+? 'compiling) '()) + => (string-port generic-write) + + (file->requires "obj2str.scm" provided? '()) + => (string-port) + + -- Function: feature->requires feature provided? catalog | + Returns a list of the features `require'd by FEATURE assuming the + predicate PROVIDED? and association-list CATALOG. + + (feature->requires 'batch (provided+? 'compiling) *catalog*) + => (tree line-i/o databases parameters string-port + pretty-print common-list-functions posix-time) + + (feature->requires 'batch provided? *catalog*) + => (tree line-i/o databases parameters string-port + pretty-print common-list-functions) + + (feature->requires 'batch provided? '((batch . "batch"))) + => (tree line-i/o databases parameters string-port + pretty-print common-list-functions) + + -- Function: feature->requires* feature provided? catalog | + Returns a list of the features transitively `require'd by FEATURE | + assuming the predicate PROVIDED? and association-list CATALOG. | + | + -- Function: file->requires* file provided? catalog | + Returns a list of the features transitively `require'd by FILE | + assuming the predicate PROVIDED? and association-list CATALOG. | + | + -- Function: file->loads file | + Returns a list of strings naming existing files loaded (load + slib:load slib:load-source macro:load defmacro:load syncase:load + synclo:load macwork:load) by FILE or any of the files it loads. + + (file->loads (in-vicinity (library-vicinity) "scainit.scm")) + => ("/usr/local/lib/slib/scaexpp.scm" + "/usr/local/lib/slib/scaglob.scm" + "/usr/local/lib/slib/scaoutp.scm") + + -- Function: load->path exp | + Given a `(load '<expr>)', where <expr> is a string or vicinity + stuff), `(load->path <expr>)' figures a path to the file. + `load->path' returns that path if it names an existing file; + otherwise #f. + + (load->path '(in-vicinity (library-vicinity) "mklibcat")) + => "/usr/local/lib/slib/mklibcat.scm" + + -- Function: file->definitions file definer ... | + Returns a list of the identifier symbols defined by SLIB (or + SLIB-style) file FILE. The optional arguments DEFINERS should be | + symbols signifying a defining form. If none are supplied, then | + the symbols `define-operation', `define', `define-syntax', and | + `defmacro' are captured. | + + (file->definitions "random.scm") + => (*random-state* make-random-state + seed->random-state copy-random-state random + random:chunk) + + -- Function: file->exports file definer ... | + Returns a list of the identifier symbols exported (advertised) by + SLIB (or SLIB-style) file FILE. The optional arguments DEFINERS | + should be symbols signifying a defining form. If none are | + supplied, then the symbols `define-operation', `define', | + `define-syntax', and `defmacro' are captured. | + + (file->exports "random.scm") + => (make-random-state seed->random-state + copy-random-state random) + + (file->exports "randinex.scm") + => (random:solid-sphere! random:hollow-sphere! + random:normal-vector! random:normal + random:exp random:uniform) + + -- Function: feature->export-alist feature catalog | + Returns a list of lists; each sublist holding the name of the file + implementing FEATURE, and the identifier symbols exported + (advertised) by SLIB (or SLIB-style) feature FEATURE, in CATALOG. + + -- Function: feature->exports feature catalog | + Returns a list of all exports of FEATURE. + +In the case of `aggregate' features, more than one file may have export +lists to report: + + (feature->export-alist 'r5rs slib:catalog)) + => (("/usr/local/lib/slib/values.scm" + call-with-values values) + ("/usr/local/lib/slib/mbe.scm" + define-syntax macro:expand + macro:load macro:eval) + ("/usr/local/lib/slib/eval.scm" + eval scheme-report-environment + null-environment interaction-environment)) + + (feature->export-alist 'stdio *catalog*) + => (("/usr/local/lib/slib/scanf.scm" + fscanf sscanf scanf scanf-read-list) + ("/usr/local/lib/slib/printf.scm" + sprintf printf fprintf) + ("/usr/local/lib/slib/stdio.scm" + stderr stdout stdin)) + + (feature->exports 'stdio slib:catalog) + => (fscanf sscanf scanf scanf-read-list + sprintf printf fprintf stderr stdout stdin) File: slib.info, Node: Module Semantics, Next: Top-level Variable References, Prev: Module Manifests, Up: Compiling Scheme - | -Module Semantics | ----------------- | - | -For the purpose of compiling Scheme code, each top-level `require' | -makes the identifiers exported by its feature's module `defined' (or | -defmacroed or defined-syntaxed) within the file (being compiled) headed | -with those requires. | - | - Top-level occurrences of `require-if' make defined the exports from | -the module named by the second argument _if_ the FEATURE-EXPRESSION | -first argument is true in the target environment. The target feature | -`compiling' should be provided during this phase of compilation. | - | - Non-top-level SLIB occurences of `require' and `require-if' of quoted | -features can be ignored by compilers. The SLIB modules will all have | -top-level constructs for those features. | - | - Note that aggregate catalog entries import more than one module. | -Implementations of `require' may or may _not_ be transitive; code which | -uses module exports without requiring the providing module is in error. | - | - In the SLIB modules `modular', `batch', `hash', `common-lisp-time', | -`commutative-ring', `charplot', `logical', `common-list-functions', | -`coerce' and `break' there is code conditional on features being | -`provided?'. Most are testing for the presence of features which are | -intrinsic to implementations (inexacts, bignums, ...). | - | - In all cases these `provided?' tests can be evaluated at compile-time | -using `feature-eval' (*note feature-eval: Feature.). The simplest way | -to compile these constructs may be to treat `provided?' as a macro. | - | + +1.6.3 Module Semantics | +---------------------- | + +For the purpose of compiling Scheme code, each top-level `require' +makes the identifiers exported by its feature's module `defined' (or +defmacroed or defined-syntaxed) within the file (being compiled) headed +with those requires. + + Top-level occurrences of `require-if' make defined the exports from +the module named by the second argument _if_ the FEATURE-EXPRESSION +first argument is true in the target environment. The target feature +`compiling' should be provided during this phase of compilation. + + Non-top-level SLIB occurences of `require' and `require-if' of quoted +features can be ignored by compilers. The SLIB modules will all have +top-level constructs for those features. + + Note that aggregate catalog entries import more than one module. +Implementations of `require' may or may _not_ be transitive; code which +uses module exports without requiring the providing module is in error. + + In the SLIB modules `modular', `batch', `hash', `common-lisp-time', +`commutative-ring', `charplot', `logical', `common-list-functions', +`coerce' and `break' there is code conditional on features being +`provided?'. Most are testing for the presence of features which are +intrinsic to implementations (inexacts, bignums, ...). + + In all cases these `provided?' tests can be evaluated at compile-time +using `feature-eval' (*note feature-eval: Feature.). The simplest way +to compile these constructs may be to treat `provided?' as a macro. + File: slib.info, Node: Top-level Variable References, Next: Module Analysis, Prev: Module Semantics, Up: Compiling Scheme - | -Top-level Variable References | ------------------------------ | - | -`(require 'top-refs)' | - | -These procedures complement those in *Note Module Manifests:: by | -finding the top-level variable references in Scheme source code. They | -work by traversing expressions and definitions, keeping track of | -bindings encountered. It is certainly possible to foil these | -functions, but they return useful information about SLIB source code. | - | - - Function: top-refs obj | - Returns a list of the top-level variables referenced by the Scheme | - expression OBJ. | - | - - Function: top-refs<-file filename | - FILENAME should be a string naming an existing file containing | - Scheme source code. `top-refs<-file' returns a list of the | - top-level variable references made by expressions in the file | - named by FILENAME. | - | - Code in modules which FILENAME `require's is not traversed. Code | - in files loaded from top-level _is_ traversed if the expression | - argument to `load', `slib:load', `slib:load-source', `macro:load', | - `defmacro:load', `synclo:load', `syncase:load', or `macwork:load' | - is a literal string constant or composed of combinations of | - vicinity functions and string literal constants; and the resulting | - file exists (possibly with ".scm" appended). | - | -The following function parses an "Info" Index. (1) | - | - - Function: exports<-info-index file n ... | - N ... must be an increasing series of positive integers. | - `exports<-info-index' returns a list of all the identifiers | - appearing in the Nth ... (info) indexes of FILE. The identifiers | - have the case that the implementation's `read' uses for symbols. | - Identifiers containing spaces (eg. `close-base on base-table') are | - _not_ included. | - | - Each info index is headed by a `* Menu:' line. To list the | - symbols in the first and third info indexes do: | - | - (exports<-info-index "slib.info" 1 3) | - | - ---------- Footnotes ---------- | - | - (1) Although it will work on large info files, feeding it an excerpt | -is much faster; and has less chance of being confused by unusual text | -in the info file. This command excerpts the SLIB index into | -`slib-index.info': | - | - info -f slib2d6.info -n "Index" -o slib-index.info | - | + +1.6.4 Top-level Variable References | +----------------------------------- | + +`(require 'top-refs)' + +These procedures complement those in *Note Module Manifests:: by +finding the top-level variable references in Scheme source code. They +work by traversing expressions and definitions, keeping track of +bindings encountered. It is certainly possible to foil these +functions, but they return useful information about SLIB source code. + + -- Function: top-refs obj | + Returns a list of the top-level variables referenced by the Scheme + expression OBJ. + + -- Function: top-refs<-file filename | + FILENAME should be a string naming an existing file containing + Scheme source code. `top-refs<-file' returns a list of the + top-level variable references made by expressions in the file + named by FILENAME. + + Code in modules which FILENAME `require's is not traversed. Code + in files loaded from top-level _is_ traversed if the expression + argument to `load', `slib:load', `slib:load-source', `macro:load', + `defmacro:load', `synclo:load', `syncase:load', or `macwork:load' + is a literal string constant or composed of combinations of + vicinity functions and string literal constants; and the resulting + file exists (possibly with ".scm" appended). + +The following function parses an "Info" Index. (1) + + -- Function: exports<-info-index file n ... | + N ... must be an increasing series of positive integers. + `exports<-info-index' returns a list of all the identifiers + appearing in the Nth ... (info) indexes of FILE. The identifiers + have the case that the implementation's `read' uses for symbols. + Identifiers containing spaces (eg. `close-base on base-table') are + _not_ included. #f is returned if the index is not found. | + + Each info index is headed by a `* Menu:' line. To list the + symbols in the first and third info indexes do: + + (exports<-info-index "slib.info" 1 3) + + ---------- Footnotes ---------- + + (1) Although it will work on large info files, feeding it an excerpt +is much faster; and has less chance of being confused by unusual text +in the info file. This command excerpts the SLIB index into +`slib-index.info': + + info -f slib2d6.info -n "Index" -o slib-index.info + File: slib.info, Node: Module Analysis, Prev: Top-level Variable References, Up: Compiling Scheme - | -Module Analysis | ---------------- | - | -`(require 'vet)' | - | - - Function: vet-slib | - Using the procedures in the `top-refs' and `manifest' modules, | - `vet-slib' analyzes each SLIB module, reporting about any | - procedure or macro defined whether it is: | - | - orphaned | - defined, not called, not exported; | - | - missing | - called, not defined, and not exported by its `require'd | - modules; | - | - undocumented-export | - Exported by module, but no index entry in `slib.info'; | - | - | - And for the library as a whole: | - | - documented-unexport | - Index entry in `slib.info', but no module exports it. | - | - | - This straightforward analysis caught three full days worth of | - never-executed branches, transitive require assumptions, spelling | - errors, undocumented procedures, missing procedures, and cyclic | - dependencies in SLIB. | + +1.6.5 Module Analysis | +--------------------- | + +`(require 'vet)' + + -- Function: vet-slib file1 ... | + Using the procedures in the `top-refs' and `manifest' modules, + `vet-slib' analyzes each SLIB module and FILE1, ..., reporting | + about any procedure or macro defined whether it is: | + + orphaned + defined, not called, not exported; + + missing + called, not defined, and not exported by its `require'd + modules; + + undocumented-export + Exported by module, but no index entry in `slib.info'; + + + And for the library as a whole: + + documented-unexport + Index entry in `slib.info', but no module exports it. + + + This straightforward analysis caught three full days worth of + never-executed branches, transitive require assumptions, spelling + errors, undocumented procedures, missing procedures, and cyclic + dependencies in SLIB. + + The optional arguments FILE1, ... provide a simple way to vet | + prospective SLIB modules. | | File: slib.info, Node: Universal SLIB Procedures, Next: Scheme Syntax Extension Packages, Prev: The Library System, Up: Top - | -Universal SLIB Procedures | -************************* | - | -The procedures described in these sections are supported by all | -implementations as part of the `*.init' files or by `require.scm'. | - | -* Menu: | - | -* Vicinity:: Pathname Management | -* Configuration:: Characteristics of Scheme Implementation | -* Input/Output:: Things not provided by the Scheme specs. | -* System:: LOADing, EVALing, ERRORing, and EXITing | -* Miscellany:: | - | + +2 Universal SLIB Procedures | +*************************** | + +The procedures described in these sections are supported by all +implementations as part of the `*.init' files or by `require.scm'. + +* Menu: + +* Vicinity:: Pathname Management +* Configuration:: Characteristics of Scheme Implementation +* Input/Output:: Things not provided by the Scheme specs. +* System:: LOADing, EVALing, ERRORing, and EXITing +* Miscellany:: + File: slib.info, Node: Vicinity, Next: Configuration, Prev: Universal SLIB Procedures, Up: Universal SLIB Procedures - | -Vicinity -======== | + +2.1 Vicinity | +============ | A vicinity is a descriptor for a place in the file system. Vicinities hide from the programmer the concepts of host, volume, directory, and @@ -721,53 +740,56 @@ version. Vicinities express only the concept of a file environment where a file name can be resolved to a file in a system independent manner. Vicinities can even be used on "flat" file systems (which have no directory structure) by having the vicinity express constraints on -the file name. On most systems a vicinity would be a string. All of -these procedures are file system dependent. +the file name. | -These procedures are provided by all implementations. + All of these procedures are file-system dependent. Use of these | +vicinity procedures can make programs file-system _in_dependent. | - - Function: make-vicinity dirpath +These procedures are provided by all implementations. On most systems | +a vicinity is a string. | + | + -- Function: make-vicinity dirpath | Returns DIRPATH as a vicinity for use as first argument to `in-vicinity'. - - Function: pathname->vicinity path + -- Function: pathname->vicinity path | Returns the vicinity containing PATH. (pathname->vicinity "/usr/local/lib/scm/Link.scm") => "/usr/local/lib/scm/" - - Function: program-vicinity + -- Function: program-vicinity | Returns the vicinity of the currently loading Scheme code. For an interpreter this would be the directory containing source code. For a compiled system (with multiple files) this would be the directory where the object or executable files are. If no file is - currently loading it the result is undefined. *Warning:* + currently loading, then the result is undefined. *Warning:* | `program-vicinity' can return incorrect values if your program - escapes back into a `load'. + escapes back into a `load' continuation. | - - Function: library-vicinity + -- Function: library-vicinity | Returns the vicinity of the shared Scheme library. - - Function: implementation-vicinity + -- Function: implementation-vicinity | Returns the vicinity of the underlying Scheme implementation. This vicinity will likely contain startup code and messages and a compiler. - - Function: user-vicinity + -- Function: user-vicinity | Returns the vicinity of the current directory of the user. On most systems this is `""' (the empty string). - - Function: home-vicinity - Returns the vicinity of the user's "HOME" directory, the directory - which typically contains files which customize a computer - environment for a user. If scheme is running without a user (eg. - a daemon) or if this concept is meaningless for the platform, then + -- Function: home-vicinity | + Returns the vicinity of the user's "HOME" directory, the directory which | + typically contains files which customize a computer environment | + for a user. If scheme is running without a user (eg. a daemon) or | + if this concept is meaningless for the platform, then | `home-vicinity' returns `#f'. - - Function: vicinity:suffix? chr | - Returns the `#t' if CHR is a vicinity suffix character; and `#f' | - otherwise. Typical vicinity suffixes are `/', `:', and `\', | - | - - Function: in-vicinity vicinity filename + -- Function: vicinity:suffix? chr | + Returns the `#t' if CHR is a vicinity suffix character; and `#f' + otherwise. Typical vicinity suffixes are `/', `:', and `\', + + -- 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 @@ -778,27 +800,34 @@ 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 return a pathname of the subdirectory NAME of VICINITY. + -- Function: with-load-pathname path thunk | + PATH should be a string naming a file being read or loaded. | + `with-load-pathname' evaluates THUNK in a dynamic scope where an | + internal variable is bound to PATH; the internal variable is used | + for messages and `program-vicinity'. `with-load-pathname' returns | + the value returned by THUNK. | + | File: slib.info, Node: Configuration, Next: Input/Output, Prev: Vicinity, Up: Universal SLIB Procedures - | -Configuration -============= | + +2.2 Configuration | +================= | These constants and procedures describe characteristics of the Scheme and underlying operating system. They are provided by all implementations. - - Constant: char-code-limit + -- Constant: char-code-limit | An integer 1 larger that the largest value which can be returned by `char->integer'. - - Constant: most-positive-fixnum + -- Constant: most-positive-fixnum | In implementations which support integers of practically unlimited size, MOST-POSITIVE-FIXNUM is a large exact integer within the range of exact integers that may result from computing the length @@ -809,39 +838,39 @@ implementations. that may result from computing the length of a list, vector, or string. - - Constant: slib:tab + -- Constant: slib:tab | The tab character. - - Constant: slib:form-feed + -- Constant: slib:form-feed | The form-feed character. - - Function: software-type + -- Function: software-type | Returns a symbol denoting the generic operating system type. For instance, `unix', `vms', `macos', `amiga', or `ms-dos'. - - Function: slib:report-version + -- Function: slib:report-version | Displays the versions of SLIB and the underlying Scheme implementation and the name of the operating system. An unspecified value is returned. - (slib:report-version) => slib "3a1" on scm "5b1" on unix | + (slib:report-version) => slib "3a2" on scm "5b1" on unix | - - Function: slib:report + -- 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 "3a1" on scm "5b1" on unix | - (implementation-vicinity) is "/usr/local/lib/scm/" | - (library-vicinity) is "/usr/local/lib/slib/" | + slib "3a2" on scm "5b1" on unix | + (implementation-vicinity) is "/usr/local/lib/scm/" + (library-vicinity) is "/usr/local/lib/slib/" (scheme-file-suffix) is ".scm" loaded *features* : trace alist qp sort @@ -851,7 +880,7 @@ implementations. bignum complex real rational inexact vicinity ed getenv tmpnam abort transcript with-file - ieee-p1178 r4rs rev4-optional-procedures hash | + ieee-p1178 r4rs rev4-optional-procedures hash object-hash delay eval dynamic-wind multiarg-apply multiarg/and- logical defmacro string-port source current-time record @@ -859,27 +888,27 @@ implementations. array dump char-ready? full-continuation system implementation *catalog* : - (i/o-extensions compiled "/usr/local/lib/scm/ioext.so") | + (i/o-extensions compiled "/usr/local/lib/scm/ioext.so") ... File: slib.info, Node: Input/Output, Next: System, Prev: Configuration, Up: Universal SLIB Procedures - | -Input/Output -============ | + +2.3 Input/Output | +================ | These procedures are provided by all implementations. - - Function: file-exists? filename + -- Function: 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. - - Function: delete-file filename + -- Function: delete-file filename | Deletes the file specified by FILENAME. If FILENAME can not be deleted, `#f' is returned. Otherwise, `#t' is returned. - - Function: open-file filename modes + -- Function: open-file filename modes | FILENAME should be a string naming a file. `open-file' returns a port depending on the symbol MODES: @@ -905,18 +934,18 @@ These procedures are provided by all implementations. signalled. For output, if a file with the given name already exists, the effect is unspecified. - - Function: port? obj + -- Function: port? obj | Returns #t if OBJ is an input or output port, otherwise returns #f. - - Procedure: close-port port + -- Procedure: close-port port | Closes the file associated with PORT, rendering the PORT incapable of delivering or accepting characters. `close-file' has no effect if the file has already been closed. The value returned is unspecified. - - Function: call-with-open-ports proc ports ... - - Function: call-with-open-ports ports ... proc + -- Function: call-with-open-ports proc ports ... | + -- Function: call-with-open-ports ports ... proc | PROC should be a procedure that accepts as many arguments as there are PORTS passed to `call-with-open-ports'. `call-with-open-ports' calls PROC with PORTS .... If PROC @@ -926,54 +955,54 @@ These procedures are provided by all implementations. to prove that the ports will never again be used for a read or write operation. - - Function: tmpnam + -- Function: tmpnam | Returns a pathname for a file which will likely not be used by any other process. Successive calls to `(tmpnam)' will return different pathnames. - - Function: current-error-port + -- Function: current-error-port | Returns the current port to which diagnostic and error output is directed. - - Procedure: force-output - - Procedure: force-output port + -- Procedure: force-output | + -- 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)'. - - Function: output-port-width - - Function: output-port-width port + -- Function: output-port-width | + -- Function: 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. - - Function: output-port-height - - Function: output-port-height port + -- Function: output-port-height | + -- Function: 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. File: slib.info, Node: System, Next: Miscellany, Prev: Input/Output, Up: Universal SLIB Procedures - | -System -====== | + +2.4 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 @@ -983,29 +1012,29 @@ 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 + -- 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 system (if possible). If N is `#f' a failure is returned to the @@ -1013,7 +1042,7 @@ These procedures are provided by all implementations. the system (if possible). If the Scheme session cannot exit an unspecified value is returned from `slib:exit'. - - Function: browse-url url + -- Function: browse-url url | Web browsers have become so ubiquitous that programming languagues should support a uniform interface to them. @@ -1028,13 +1057,13 @@ These procedures are provided by all implementations. File: slib.info, Node: Miscellany, Prev: System, Up: Universal SLIB Procedures - | -Miscellany -========== | + +2.5 Miscellany | +============== | These procedures are provided by all implementations. - - Function: identity x + -- Function: identity x | IDENTITY returns its argument. Example: @@ -1045,15 +1074,24 @@ These procedures are provided by all implementations. (map identity LST) == (copy-list LST) -Mutual Exclusion ----------------- | + -- Function: expt n k | + Returns N raised to the non-negative integer exponent K. | -An "exchanger" is a procedure of one argument regulating mutually -exclusive access to a resource. When a exchanger is called, its current -content is returned, while being replaced by its argument in an atomic + Example: | + (expt 2 5) | + => 32 | + (expt -3 3) | + => -27 | + | +2.5.1 Mutual Exclusion | +---------------------- | + | +An "exchanger" is a procedure of one argument regulating mutually exclusive | +access to a resource. When a exchanger is called, its current content | +is returned, while being replaced by its argument in an atomic | operation. - - Function: make-exchanger obj + -- Function: make-exchanger obj | Returns a new exchanger with the argument OBJ as its initial content. @@ -1071,25 +1109,25 @@ operation. (set! lst (cdr lst)) ret))) (lambda () (and lst (queue lst)))))) - + (pop queue) => a - + (pop queue) => #f -Legacy ------- | +2.5.2 Legacy | +------------ | The following procedures were present in Scheme until R4RS (*note Language changes: (r4rs)Notes.). They are provided by all SLIB implementations. - - Constant: t + -- Constant: t | Derfined as `#t'. - - Constant: nil + -- 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) @@ -1099,9 +1137,9 @@ implementations. File: slib.info, Node: Scheme Syntax Extension Packages, Next: Textual Conversion Packages, Prev: Universal SLIB Procedures, Up: Top - | -Scheme Syntax Extension Packages -******************************** + +3 Scheme Syntax Extension Packages | +********************************** | * Menu: @@ -1115,28 +1153,29 @@ Scheme Syntax Extension Packages Syntax extensions (macros) included with SLIB. +* Define-Structure:: 'structure | * Fluid-Let:: 'fluid-let * Yasos:: 'yasos, 'oop, 'collect File: slib.info, Node: Defmacro, Next: R4RS Macros, Prev: Scheme Syntax Extension Packages, Up: Scheme Syntax Extension Packages -Defmacro -======== +3.1 Defmacro | +============ | Defmacros are supported by all implementations. - - Function: gentemp + -- Function: gentemp | Returns a new (interned) symbol each time it is called. The symbol names are implementation-dependent (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. @@ -1144,11 +1183,11 @@ Defmacros are supported by all implementations. 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 @@ -1157,26 +1196,26 @@ Defmacros are supported by all implementations. `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', `defmacro:macroexpand*', or `defmacro:load'. -Defmacroexpand --------------- +3.1.1 Defmacroexpand | +-------------------- | -`(require 'defmacroexpand)' +`(require 'defmacroexpand)' - - Function: defmacro:expand* e + -- Function: defmacro:expand* e | Returns the result of expanding all defmacros in scheme expression E. File: slib.info, Node: R4RS Macros, Next: Macro by Example, Prev: Defmacro, Up: Scheme Syntax Extension Packages -R4RS Macros -=========== +3.2 R4RS Macros | +=============== | `(require 'macro)' is the appropriate call if you want R4RS high-level macros but don't care about the low level implementation. If an SLIB @@ -1186,15 +1225,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 @@ -1205,10 +1244,10 @@ interface: File: slib.info, Node: Macro by Example, Next: Macros That Work, Prev: R4RS Macros, Up: Scheme Syntax Extension Packages -Macro by Example -================ +3.3 Macro by Example | +==================== | -`(require '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'. @@ -1225,8 +1264,8 @@ R4RS) by Dorai Sitaram, (dorai @ cs.rice.edu) using `defmacro'. natively supported (most implementations) -Caveat ------- +3.3.1 Caveat | +------------ | These macros are not referentially transparent (*note Macros: (r4rs)Macros.). Lexically scoped macros (i.e., `let-syntax' and @@ -1240,7 +1279,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'. @@ -1257,7 +1296,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 @@ -1280,28 +1319,28 @@ Syntax-Case Macros::. File: slib.info, Node: Macros That Work, Next: Syntactic Closures, Prev: Macro by Example, Up: Scheme Syntax Extension Packages -Macros That Work -================ +3.4 Macros That Work | +==================== | -`(require 'macros-that-work)' +`(require 'macros-that-work)' `Macros That Work' differs from the other R4RS macro implementations 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 @@ -1316,17 +1355,18 @@ Rees [editors]. To appear in LISP Pointers. Also available as a technical report from the University of Oregon, MIT AI Lab, and Cornell. Macros That Work. Clinger and Rees. POPL '91. - The supported syntax -differs from the R4RS in that vectors are allowed as patterns and as -templates and are not allowed as pattern or template data. + | + The supported syntax differs from the R4RS in that vectors are allowed | +as patterns and as templates and are not allowed as pattern or template | +data. | transformer spec ==> (syntax-rules literals rules) - + rules ==> () | (rule . rules) - + rule ==> (pattern template) - + pattern ==> pattern_var ; a symbol not in literals | symbol ; a symbol in literals | () @@ -1335,33 +1375,33 @@ templates and are not allowed as pattern or template data. | #(pattern*) ; extends R4RS | #(pattern* ellipsis_pattern) ; extends R4RS | pattern_datum - + template ==> pattern_var | symbol | () | (template2 . template2) | #(template*) ; extends R4RS | pattern_datum - + template2 ==> template | ellipsis_template - + pattern_datum ==> string ; no vector | character | boolean | number - + ellipsis_pattern ==> pattern ... - + ellipsis_template ==> template ... - + pattern_var ==> symbol ; not in literals - + literals ==> () | (symbol . literals) -Definitions ------------ +3.4.1 Definitions | +----------------- | Scope of an ellipsis Within a pattern or template, the scope of an ellipsis (`...') is @@ -1393,8 +1433,8 @@ Variables opened by an ellipsis template ellipsis template. -Restrictions ------------- +3.4.2 Restrictions | +------------------ | No pattern variable appears more than once within a pattern. @@ -1410,7 +1450,7 @@ template must all be bound to sequences of the same length. The compiled form of a RULE is rule ==> (pattern template inserted) - + pattern ==> pattern_var | symbol | () @@ -1418,34 +1458,34 @@ template must all be bound to sequences of the same length. | ellipsis_pattern | #(pattern) | pattern_datum - + template ==> pattern_var | symbol | () | (template2 . template2) | #(pattern) | pattern_datum - + template2 ==> template | ellipsis_template - + pattern_datum ==> string | character | boolean | number - + pattern_var ==> #(V symbol rank) - + ellipsis_pattern ==> #(E pattern pattern_vars) - + ellipsis_template ==> #(E template pattern_vars) - + inserted ==> () | (symbol . inserted) - + pattern_vars ==> () | (pattern_var . pattern_vars) - + rank ==> exact non-negative integer where V and E are unforgeable values. @@ -1462,24 +1502,24 @@ unnecessarily. That shouldn't matter very often. File: slib.info, Node: Syntactic Closures, Next: Syntax-Case Macros, Prev: Macros That Work, Up: Scheme Syntax Extension Packages -Syntactic Closures -================== +3.5 Syntactic Closures | +====================== | -`(require '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 @@ -1487,19 +1527,19 @@ Syntactic Closures definitions. The `macro:load' procedure does not affect the values returned by `current-input-port' and `current-output-port'. -Syntactic Closure Macro Facility --------------------------------- +3.5.1 Syntactic Closure Macro Facility | +-------------------------------------- | A Syntactic Closures Macro Facility by Chris Hanson 9 November 1991 - This -document describes "syntactic closures", a low-level macro facility for -the Scheme programming language. The facility is an alternative to the -low-level macro facility described in the `Revised^4 Report on Scheme.' -This document is an addendum to that report. + | + This document describes "syntactic closures", a low-level macro | +facility for the Scheme programming language. The facility is an | +alternative to the low-level macro facility described in the `Revised^4 | +Report on Scheme.' This document is an addendum to that report. | -The syntactic closures facility extends the BNF rule for TRANSFORMER + The syntactic closures facility extends the BNF rule for TRANSFORMER SPEC to allow a new keyword that introduces a low-level macro transformer: @@ -1517,8 +1557,8 @@ macro transformers are defined. The third part describes the use of "identifiers", which extend the syntactic closure mechanism to be compatible with `syntax-rules'. -Terminology -........... +3.5.1.1 Terminology | +................... | This section defines the concepts and data types used by the syntactic closures facility. @@ -1565,13 +1605,13 @@ closures facility. structure is replaced by its form. -Transformer Definition -...................... +3.5.1.2 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. @@ -1635,7 +1675,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 @@ -1669,7 +1709,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, @@ -1759,8 +1799,8 @@ procedures `make-syntactic-closure' and `capture-syntactic-environment'. (lambda (transformer-env) ...)))) -Identifiers -........... +3.5.1.3 Identifiers | +................... | This section describes the procedures that create and manipulate identifiers. Previous syntactic closure proposals did not have an @@ -1792,7 +1832,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: @@ -1826,7 +1866,7 @@ roles of the substituted input subforms. environment as the symbol `else' means in the transformer environment. - - Function: identifier=? environment1 identifier1 environment2 + -- Function: identifier=? environment1 identifier1 environment2 | identifier2 ENVIRONMENT1 and ENVIRONMENT2 must be syntactic environments, and IDENTIFIER1 and IDENTIFIER2 must be identifiers. `identifier=?' @@ -1859,8 +1899,8 @@ roles of the substituted input subforms. (foobar)))) => (#f #t) -Acknowledgements -................ +3.5.1.4 Acknowledgements | +........................ | The syntactic closures facility was invented by Alan Bawden and Jonathan Rees. The use of aliases to implement `syntax-rules' was invented by @@ -1868,26 +1908,26 @@ Alan Bawden (who prefers to call them "synthetic names"). Much of this proposal is derived from an earlier proposal by Alan Bawden. -File: slib.info, Node: Syntax-Case Macros, Next: Fluid-Let, Prev: Syntactic Closures, Up: Scheme Syntax Extension Packages - -Syntax-Case Macros -================== +File: slib.info, Node: Syntax-Case Macros, Next: Define-Structure, Prev: Syntactic Closures, Up: Scheme Syntax Extension Packages + | +3.6 Syntax-Case Macros | +====================== | -`(require 'syntax-case)' +`(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 @@ -1940,8 +1980,8 @@ distribution by anonymous FTP in SPARCstation SLC (with SCM) and about 90s on a Macintosh SE/30 (with Gambit). -Notes ------ +3.6.1 Notes | +----------- | All R4RS syntactic forms are defined, including `delay'. Along with `delay' are simple definitions for `make-promise' (into which `delay' @@ -1970,24 +2010,68 @@ 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). -Note from SLIB maintainer | -------------------------- | + +File: slib.info, Node: Define-Structure, Next: Fluid-Let, Prev: Syntax-Case Macros, Up: Scheme Syntax Extension Packages + | +3.7 Define-Structure | +==================== | + +`(require 'structure)' -`(require 'structure)' | +Included with the `syntax-case' files was `structure.scm' which defines | +a macro `define-structure'. Here is its documentation from Gambit 4.0: | + | + -- special form: define-structure NAME FIELD... | + Record data types similar to Pascal records and C `struct' types | + can be defined using the `define-structure' special form. The | + identifier NAME specifies the name of the new data type. The | + structure name is followed by K identifiers naming each field of | + the record. The `define-structure' expands into a set of | + definitions of the following procedures: | + | + * `make-NAME' - A K argument procedure which constructs a new | + record from the value of its K fields. | + | + * `NAME?' - A procedure which tests if its single argument is | + of the given record type. | + | + * `NAME-FIELD' - For each field, a procedure taking as its | + single argument a value of the given record type and returning | + the content of the corresponding field of the record. | + | + * `NAME-FIELD-set!' - For each field, a two argument procedure | + taking as its first argument a value of the given record | + type. The second argument gets assigned to the corresponding | + field of the record and the void object is returned. | + | + | + Gambit record data types have a printed representation that | + includes the name of the type and the name and value of each field. | + | + For example: | + | + > (define-structure point x y color) | + > (define p (make-point 3 5 'red)) | + > p | + #<point #3 x: 3 y: 5 color: red> | + > (point-x p) | + 3 | + > (point-color p) | + red | + > (point-color-set! p 'black) | + > p | + #<point #3 x: 3 y: 5 color: black> | | - Included with the `syntax-case' files was `structure.scm' which | -defines a macro `define-structure'. I have no documentation for this | -macro; it is not used by any other code in SLIB. | -File: slib.info, Node: Fluid-Let, Next: Yasos, Prev: Syntax-Case Macros, Up: Scheme Syntax Extension Packages - -Fluid-Let -========= +File: slib.info, Node: Fluid-Let, Next: Yasos, Prev: Define-Structure, Up: Scheme Syntax Extension Packages + | +3.8 Fluid-Let | +============= | -`(require 'fluid-let)' +`(require 'fluid-let)' - - Syntax: fluid-let `(BINDINGS ...)' FORMS... + -- Syntax: fluid-let `(BINDINGS ...)' FORMS... | (fluid-let ((VARIABLE INIT) ...) EXPRESSION EXPRESSION ...) @@ -2007,10 +2091,10 @@ of its corresponding VARIABLE. File: slib.info, Node: Yasos, Prev: Fluid-Let, Up: Scheme Syntax Extension Packages -Yasos -===== +3.9 Yasos | +========= | -`(require 'oop)' or `(require 'yasos)' +`(require 'oop)' or `(require 'yasos)' `Yet Another Scheme Object System' is a simple object system for Scheme based on the paper by Norman Adams and Jonathan Rees: `Object @@ -2032,8 +2116,8 @@ on LISP and Functional Programming, July 1988 [ACM #552880]. File: slib.info, Node: Yasos terms, Next: Yasos interface, Prev: Yasos, Up: Yasos -Terms ------ +3.9.1 Terms | +----------- | "Object" Any Scheme data object. @@ -2063,25 +2147,25 @@ _Disclaimer:_ File: slib.info, Node: Yasos interface, Next: Setters, Prev: Yasos terms, Up: Yasos -Interface ---------- +3.9.2 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. - - Syntax: object `((NAME SELF ARG ...) BODY)' ... + -- Syntax: object `((NAME SELF ARG ...) BODY)' ... | Returns an object (an instance of the object system) with 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`)' ...`)' + -- 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 @@ -2090,17 +2174,17 @@ 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 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 @@ -2109,8 +2193,8 @@ Interface File: slib.info, Node: Setters, Next: Yasos examples, Prev: Yasos interface, Up: Yasos -Setters -------- +3.9.3 Setters | +------------- | "Setters" implement "generalized locations" for objects associated with some sort of mutable state. A "getter" operation retrieves a value @@ -2127,7 +2211,7 @@ are predefined, corresponding to getters `car', `cdr', `string-ref' and 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!': @@ -2135,7 +2219,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 @@ -2148,17 +2232,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 @@ -2167,18 +2251,18 @@ through `setf'. File: slib.info, Node: Yasos examples, Prev: Setters, Up: Yasos -Examples --------- +3.9.4 Examples | +-------------- | ;;; These definitions for PRINT and SIZE are ;;; already supplied by (require 'yasos) - + (define-operation (print obj port) (format port (if (instance? obj) "#<instance>" "~s") obj)) - + (define-operation (size obj) (cond ((vector? obj) (vector-length obj)) @@ -2188,11 +2272,11 @@ Examples ((char? obj) 1) (else (slib:error "Operation not supported: size" obj)))) - + (define-predicate cell?) (define-operation (fetch obj)) (define-operation (store! obj newValue)) - + (define (make-cell value) (object ((cell? self) #t) @@ -2203,10 +2287,10 @@ Examples ((size self) 1) ((print self port) (format port "#<Cell: ~s>" (fetch self))))) - + (define-operation (discard obj value) (format #t "Discarding ~s~%" value)) - + (define (make-filtered-cell value filter) (object-with-ancestors ((cell (make-cell value))) @@ -2214,11 +2298,11 @@ Examples (if (filter newValue) (store! cell newValue) (discard self newValue))))) - + (define-predicate array?) (define-operation (array-ref array index)) (define-operation (array-set! array index value)) - + (define (make-array num-slots) (let ((anArray (make-vector num-slots))) (object @@ -2230,10 +2314,10 @@ Examples (vector-set! anArray index newValue)) ((print self port) (format port "#<Array ~s>" (size self)))))) - + (define-operation (position obj)) (define-operation (discarded-value obj)) - + (define (make-cell-with-history value filter size) (let ((pos 0) (most-recent-discard #f)) (object-with-ancestors @@ -2251,7 +2335,7 @@ Examples ((print self port) (format port "#<Cell-with-history ~s>" (fetch self)))))) - + (define-access-operation fetch) (add-setter fetch store!) (define foo (make-cell 1)) @@ -2267,8 +2351,8 @@ Examples File: slib.info, Node: Textual Conversion Packages, Next: Mathematical Packages, Prev: Scheme Syntax Extension Packages, Up: Top -Textual Conversion Packages -*************************** +4 Textual Conversion Packages | +***************************** | * Menu: @@ -2289,10 +2373,10 @@ Textual Conversion Packages File: slib.info, Node: Precedence Parsing, Next: Format, Prev: Textual Conversion Packages, Up: Textual Conversion Packages -Precedence Parsing -================== +4.1 Precedence Parsing | +====================== | -`(require 'precedence-parse)' or `(require 'parse)' +`(require 'precedence-parse)' or `(require 'parse)' This package implements: @@ -2317,8 +2401,8 @@ This package implements: File: slib.info, Node: Precedence Parsing Overview, Next: Rule Types, Prev: Precedence Parsing, Up: Precedence Parsing -Precedence Parsing Overview ---------------------------- +4.1.1 Precedence Parsing Overview | +--------------------------------- | This package offers improvements over previous parsers. @@ -2350,7 +2434,7 @@ A syntax tree is not built unless the rules explicitly do so. The call graph of grammar rules effectively instantiate the sytnax tree. The JACAL symbolic math system -(<http://swissnet.ai.mit.edu/~jaffer/JACAL.html>) uses +(`http://swiss.csail.mit.edu/~jaffer/JACAL.html') uses | precedence-parse. Its grammar definitions in the file `jacal/English.scm' can serve as examples of use. @@ -2362,65 +2446,65 @@ file) with a non-trivial grammar utilizing all constructs. File: slib.info, Node: Rule Types, Next: Ruleset Definition and Use, Prev: Precedence Parsing Overview, Up: Precedence Parsing -Rule Types ----------- +4.1.2 Rule Types | +---------------- | Here are the higher-level syntax types and an example of each. Precedence considerations are omitted for clarity. See *Note Grammar Rule Definition:: for full details. - - Grammar: nofix bye exit + -- Grammar: nofix bye exit | bye calls the function `exit' with no arguments. - - Grammar: prefix - negate + -- Grammar: prefix - negate | - 42 Calls the function `negate' with the argument `42'. - - Grammar: infix - difference + -- Grammar: infix - difference | x - y Calls the function `difference' with arguments `x' and `y'. - - Grammar: nary + sum + -- Grammar: nary + sum | x + y + z Calls the function `sum' with arguments `x', `y', and `y'. - - Grammar: postfix ! factorial + -- Grammar: postfix ! factorial | 5 ! Calls the function `factorial' with the argument `5'. - - Grammar: prestfix set set! + -- Grammar: prestfix set set! | set foo bar Calls the function `set!' with the arguments `foo' and `bar'. - - Grammar: commentfix /* */ + -- Grammar: commentfix /* */ | /* almost any text here */ Ignores the comment delimited by `/*' and `*/'. - - Grammar: matchfix { list } + -- Grammar: matchfix { list } | {0, 1, 2} Calls the function `list' with the arguments `0', `1', and `2'. - - Grammar: inmatchfix ( funcall ) + -- Grammar: inmatchfix ( funcall ) | f(x, y) Calls the function `funcall' with the arguments `f', `x', and `y'. - - Grammar: delim ; + -- Grammar: delim ; | set foo bar; delimits the extent of the restfix operator `set'. File: slib.info, Node: Ruleset Definition and Use, Next: Token definition, Prev: Rule Types, Up: Precedence Parsing -Ruleset Definition and Use --------------------------- +4.1.3 Ruleset Definition and Use | +-------------------------------- | - - Variable: *syn-defs* + -- Variable: *syn-defs* | A grammar is built by one or more calls to `prec:define-grammar'. The rules are appended to *SYN-DEFS*. The value of *SYN-DEFS* is the grammar suitable for passing as an argument to `prec:parse'. - - Constant: *syn-ignore-whitespace* + -- Constant: *syn-ignore-whitespace* | Is a nearly empty grammar with whitespace characters set to group 0, which means they will not be made into tokens. Most rulesets will want to start with `*syn-ignore-whitespace*' @@ -2428,12 +2512,11 @@ Ruleset Definition and Use In order to start defining a grammar, either (set! *syn-defs* '()) - -or + 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. @@ -2442,8 +2525,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*. @@ -2467,15 +2550,15 @@ variable (for use when calling `prec:parse'). The PORT argument may be omitted, in which case it defaults to the value returned by `current-input-port'. It is an error to parse - from a closed port. + from a closed port. File: slib.info, Node: Token definition, Next: Nud and Led Definition, Prev: Ruleset Definition and Use, Up: Precedence Parsing -Token definition ----------------- +4.1.4 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. @@ -2509,34 +2592,34 @@ Token definition The following convenient constants are provided for use with `tok:char-group'. - - Constant: tok:decimal-digits + -- Constant: tok:decimal-digits | Is the string `"0123456789"'. - - Constant: tok:upper-case + -- Constant: tok:upper-case | Is the string consisting of all upper-case letters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"). - - Constant: tok:lower-case + -- Constant: tok:lower-case | Is the string consisting of all lower-case letters ("abcdefghijklmnopqrstuvwxyz"). - - Constant: tok:whitespaces + -- Constant: tok:whitespaces | Is the string consisting of all characters between 0 and 255 for which `char-whitespace?' returns true. -For the purpose of reporting problems in error messages, this package | -keeps track of the "current column". When the column does not simply | -track input characters, `tok:bump-column' can be used to adjust the | -current-column. | - | - - Function: tok:bump-column pos port | - Adds POS to the current-column for input-port PORT. | - | +For the purpose of reporting problems in error messages, this package +keeps track of the "current column". When the column does not simply +track input characters, `tok:bump-column' can be used to adjust the +current-column. + + -- Function: tok:bump-column pos port | + Adds POS to the current-column for input-port PORT. + File: slib.info, Node: Nud and Led Definition, Next: Grammar Rule Definition, Prev: Token definition, Up: Precedence Parsing -Nud and Led Definition ----------------------- +4.1.5 Nud and Led Definition | +---------------------------- | This section describes advanced features. You can skip this section on first reading. @@ -2570,7 +2653,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 @@ -2580,7 +2663,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 @@ -2593,8 +2676,8 @@ issues a warning. File: slib.info, Node: Grammar Rule Definition, Prev: Nud and Led Definition, Up: Precedence Parsing -Grammar Rule Definition ------------------------ +4.1.6 Grammar Rule Definition | +----------------------------- | Here are procedures for defining rules for the syntax types introduced in *Note Precedence Parsing Overview::. @@ -2613,19 +2696,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 @@ -2642,7 +2725,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: @@ -2661,7 +2744,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: @@ -2674,7 +2757,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: @@ -2683,7 +2766,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 @@ -2700,7 +2783,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: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 @@ -2720,7 +2803,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 @@ -2740,7 +2823,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: @@ -2765,53 +2848,520 @@ will both match token strings; i.e. tokens resulting from token groups. File: slib.info, Node: Format, Next: Standard Formatted I/O, Prev: Precedence Parsing, Up: Textual Conversion Packages -Format (version 3.0) -==================== +4.2 Format (version 3.1) | +======================== | -The `format.scm' package was removed because it was not reentrant. | -<http://swissnet.ai.mit.edu/~jaffer/SLIB.FAQ> explains more about | -FORMAT's woes. | +`(require 'format)' | + | +* Menu: | + | +* Format Interface:: | +* Format Specification:: | + | + +File: slib.info, Node: Format Interface, Next: Format Specification, Prev: Format, Up: Format + | +4.2.1 Format Interface | +---------------------- | + | + -- 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 | + available Scheme format implementations. | + | + Returns `#t', `#f' or a string; has side effect of printing | + according to FORMAT-STRING. If DESTINATION is `#t', the output is | + to the current output port and `#t' is returned. If DESTINATION | + is `#f', a formatted string is returned as the result of the call. | + NEW: If DESTINATION is a string, DESTINATION is regarded as the | + format string; FORMAT-STRING is then the first argument and the | + output is returned as a string. If DESTINATION is a number, the | + output is to the current error port if available by the | + implementation. Otherwise DESTINATION must be an output port and | + `#t' is returned. | + | + FORMAT-STRING must be a string. In case of a formatting error | + format returns `#f' and prints a message on the current output or | + error port. Characters are output as if the string were output by | + the `display' function with the exception of those prefixed by a | + tilde (~). For a detailed description of the FORMAT-STRING syntax | + please consult a Common LISP format reference manual. For a test | + suite to verify this format implementation load `formatst.scm'. | + Please send bug reports to `lutzeb@cs.tu-berlin.de'. | + | + Note: `format' is not reentrant, i.e. only one `format'-call may | + be executed at a time. | + | + | + +File: slib.info, Node: Format Specification, Prev: Format Interface, Up: Format + | +4.2.2 Format Specification (Format version 3.1) | +----------------------------------------------- | + | +Please consult a Common LISP format reference manual for a detailed | +description of the format string syntax. For a demonstration of the | +implemented directives see `formatst.scm'. | + | + This implementation supports directive parameters and modifiers (`:' | +and `@' characters). Multiple parameters must be separated by a comma | +(`,'). Parameters can be numerical parameters (positive or negative), | +character parameters (prefixed by a quote character (`''), variable | +parameters (`v'), number of rest arguments parameter (`#'), empty and | +default parameters. Directive characters are case independent. The | +general form of a directive is: | + | +DIRECTIVE ::= ~{DIRECTIVE-PARAMETER,}[:][@]DIRECTIVE-CHARACTER | + | +DIRECTIVE-PARAMETER ::= [ [-|+]{0-9}+ | 'CHARACTER | v | # ] | + | +4.2.2.1 Implemented CL Format Control Directives | +................................................ | + | +Documentation syntax: Uppercase characters represent the corresponding | +control directive characters. Lowercase characters represent control | +directive parameter descriptions. | + | +`~A' | + Any (print as `display' does). | + `~@A' | + left pad. | + | + `~MINCOL,COLINC,MINPAD,PADCHARA' | + full padding. | + | +`~S' | + S-expression (print as `write' does). | + `~@S' | + left pad. | + | + `~MINCOL,COLINC,MINPAD,PADCHARS' | + full padding. | + | +`~D' | + Decimal. | + `~@D' | + print number sign always. | + | + `~:D' | + print comma separated. | + | + `~MINCOL,PADCHAR,COMMACHARD' | + padding. | + | +`~X' | + Hexadecimal. | + `~@X' | + print number sign always. | + | + `~:X' | + print comma separated. | + | + `~MINCOL,PADCHAR,COMMACHARX' | + padding. | + | +`~O' | + Octal. | + `~@O' | + print number sign always. | + | + `~:O' | + print comma separated. | + | + `~MINCOL,PADCHAR,COMMACHARO' | + padding. | + | +`~B' | + Binary. | + `~@B' | + print number sign always. | + | + `~:B' | + print comma separated. | + | + `~MINCOL,PADCHAR,COMMACHARB' | + padding. | + | +`~NR' | + Radix N. | + `~N,MINCOL,PADCHAR,COMMACHARR' | + padding. | + | +`~@R' | + print a number as a Roman numeral. | + | +`~:@R' | + print a number as an "old fashioned" Roman numeral. | + | +`~:R' | + print a number as an ordinal English number. | + | +`~R' | + print a number as a cardinal English number. | + | +`~P' | + Plural. | + `~@P' | + prints `y' and `ies'. | + | + `~:P' | + as `~P but jumps 1 argument backward.' | + | + `~:@P' | + as `~@P but jumps 1 argument backward.' | + | +`~C' | + Character. | + `~@C' | + prints a character as the reader can understand it (i.e. `#\' | + prefixing). | + | + `~:C' | + prints a character as emacs does (eg. `^C' for ASCII 03). | + | +`~F' | + Fixed-format floating-point (prints a flonum like MMM.NNN). | + `~WIDTH,DIGITS,SCALE,OVERFLOWCHAR,PADCHARF' | + | + `~@F' | + If the number is positive a plus sign is printed. | + | +`~E' | + Exponential floating-point (prints a flonum like MMM.NNN`E'EE). | + `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARE' | + | + `~@E' | + If the number is positive a plus sign is printed. | + | +`~G' | + General floating-point (prints a flonum either fixed or | + exponential). | + `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARG' | + | + `~@G' | + If the number is positive a plus sign is printed. | + | +`~$' | + Dollars floating-point (prints a flonum in fixed with signs | + separated). | + `~DIGITS,SCALE,WIDTH,PADCHAR$' | + | + `~@$' | + If the number is positive a plus sign is printed. | + | + `~:@$' | + A sign is always printed and appears before the padding. | + | + `~:$' | + The sign appears before the padding. | + | +`~%' | + Newline. | + `~N%' | + print N newlines. | + | +`~&' | + print newline if not at the beginning of the output line. | + `~N&' | + prints `~&' and then N-1 newlines. | + | +`~|' | + Page Separator. | + `~N|' | + print N page separators. | + | +`~~' | + Tilde. | + `~N~' | + print N tildes. | + | +`~'<newline> | + Continuation Line. | + `~:'<newline> | + newline is ignored, white space left. | + | + `~@'<newline> | + newline is left, white space ignored. | + | +`~T' | + Tabulation. | + `~@T' | + relative tabulation. | + | + `~COLNUM,COLINCT' | + full tabulation. | + | +`~?' | + Indirection (expects indirect arguments as a list). | + `~@?' | + extracts indirect arguments from format arguments. | + | +`~(STR~)' | + Case conversion (converts by `string-downcase'). | + `~:(STR~)' | + converts by `string-capitalize'. | + | + `~@(STR~)' | + converts by `string-capitalize-first'. | + | + `~:@(STR~)' | + converts by `string-upcase'. | + | +`~*' | + Argument Jumping (jumps 1 argument forward). | + `~N*' | + jumps N arguments forward. | + | + `~:*' | + jumps 1 argument backward. | + | + `~N:*' | + jumps N arguments backward. | + | + `~@*' | + jumps to the 0th argument. | + | + `~N@*' | + jumps to the Nth argument (beginning from 0) | + | +`~[STR0~;STR1~;...~;STRN~]' | + Conditional Expression (numerical clause conditional). | + `~N[' | + take argument from N. | + | + `~@[' | + true test conditional. | + | + `~:[' | + if-else-then conditional. | + | + `~;' | + clause separator. | + | + `~:;' | + default clause follows. | + | +`~{STR~}' | + Iteration (args come from the next argument (a list)). Iteration | + bounding is controlled by configuration variables | + FORMAT:ITERATION-BOUNDED and FORMAT:MAX-ITERATIONS. With both | + variables default, a maximum of 100 iterations will be performed. | + `~N{' | + at most N iterations. | + | + `~:{' | + args from next arg (a list of lists). | + | + `~@{' | + args from the rest of arguments. | + | + `~:@{' | + args from the rest args (lists). | + | +`~^' | + Up and out. | + `~N^' | + aborts if N = 0 | + | + `~N,M^' | + aborts if N = M | + | + `~N,M,K^' | + aborts if N <= M <= K | + | +4.2.2.2 Not Implemented CL Format Control Directives | +.................................................... | + | +`~:A' | + print `#f' as an empty list (see below). | + | +`~:S' | + print `#f' as an empty list (see below). | + | +`~<~>' | + Justification. | + | +`~:^' | + (sorry I don't understand its semantics completely) | + | +4.2.2.3 Extended, Replaced and Additional Control Directives | +............................................................ | + | +`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHD' | + | +`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHX' | + | +`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHO' | + | +`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHB' | + | +`~N,MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHR' | + COMMAWIDTH is the number of characters between two comma | + characters. | + | +`~I' | + print a R4RS complex number as `~F~@Fi' with passed parameters for | + `~F'. | + | +`~Y' | + Pretty print formatting of an argument for scheme code lists. | + | +`~K' | + Same as `~?.' | + | +`~!' | + Flushes the output if format DESTINATION is a port. | + | +`~_' | + Print a `#\space' character | + `~N_' | + print N `#\space' characters. | + | +`~/' | + Print a `#\tab' character | + `~N/' | + print N `#\tab' characters. | + | +`~NC' | + Takes N as an integer representation for a character. No arguments | + are consumed. N is converted to a character by `integer->char'. N | + must be a positive decimal number. | + | +`~:S' | + Print out readproof. Prints out internal objects represented as | + `#<...>' as strings `"#<...>"' so that the format output can always | + be processed by `read'. | + | +`~:A' | + Print out readproof. Prints out internal objects represented as | + `#<...>' as strings `"#<...>"' so that the format output can always | + be processed by `read'. | + | +`~Q' | + Prints information and a copyright notice on the format | + implementation. | + `~:Q' | + prints format version. | + | +`~F, ~E, ~G, ~$' | + may also print number strings, i.e. passing a number as a string | + and format it accordingly. | + | +4.2.2.4 Configuration Variables | +............................... | + | +Format has some configuration variables at the beginning of | +`format.scm' to suit the systems and users needs. There should be no | +modification necessary for the configuration that comes with SLIB. If | +modification is desired the variable should be set after the format | +code is loaded. Format detects automatically if the running scheme | +system implements floating point numbers and complex numbers. | + | +FORMAT:SYMBOL-CASE-CONV | + Symbols are converted by `symbol->string' so the case type of the | + printed symbols is implementation dependent. | + `format:symbol-case-conv' is a one arg closure which is either | + `#f' (no conversion), `string-upcase', `string-downcase' or | + `string-capitalize'. (default `#f') | + | +FORMAT:IOBJ-CASE-CONV | + As FORMAT:SYMBOL-CASE-CONV but applies for the representation of | + implementation internal objects. (default `#f') | + | +FORMAT:EXPCH | + The character prefixing the exponent value in `~E' printing. | + (default `#\E') | + | +FORMAT:ITERATION-BOUNDED | + When `#t', a `~{...~}' control will iterate no more than the | + number of times specified by FORMAT:MAX-ITERATIONS regardless of | + the number of iterations implied by modifiers and arguments. When | + `#f', a `~{...~}' control will iterate the number of times implied | + by modifiers and arguments, unless termination is forced by | + language or system limitations. (default `#t') | + | +FORMAT:MAX-ITERATIONS | + The maximum number of iterations performed by a `~{...~}' control. | + Has effect only when FORMAT:ITERATION-BOUNDED is `#t'. (default | + 100) | + | + | +4.2.2.5 Compatibility With Other Format Implementations | +....................................................... | + | +SLIB format 2.x: | + See `format.doc'. | + | +SLIB format 1.4: | + Downward compatible except for padding support and `~A', `~S', | + `~P', `~X' uppercase printing. SLIB format 1.4 uses C-style | + `printf' padding support which is completely replaced by the CL | + `format' padding style. | + | +MIT C-Scheme 7.1: | + Downward compatible except for `~', which is not documented | + (ignores all characters inside the format string up to a newline | + character). (7.1 implements `~a', `~s', ~NEWLINE, `~~', `~%', | + numerical and variable parameters and `:/@' modifiers in the CL | + sense). | + | +Elk 1.5/2.0: | + Downward compatible except for `~A' and `~S' which print in | + uppercase. (Elk implements `~a', `~s', `~~', and `~%' (no | + directive parameters or modifiers)). | + | +Scheme->C 01nov91: | + Downward compatible except for an optional destination parameter: | + S2C accepts a format call without a destination which returns a | + formatted string. This is equivalent to a #f destination in S2C. | + (S2C implements `~a', `~s', `~c', `~%', and `~~' (no directive | + parameters or modifiers)). | + | + | + This implementation of format is solely useful in the SLIB context | +because it requires other components provided by SLIB. | File: slib.info, Node: Standard Formatted I/O, Next: Programs and Arguments, Prev: Format, Up: Textual Conversion Packages -Standard Formatted I/O -====================== +4.3 Standard Formatted I/O | +========================== | * Menu: * Standard Formatted Output:: 'printf * Standard Formatted Input:: 'scanf -stdio ------ +4.3.1 stdio | +----------- | -`(require 'stdio)' +`(require 'stdio)' `require's `printf' and `scanf' and additionally defines the symbols: - - Variable: stdin + -- Variable: stdin | Defined to be `(current-input-port)'. - - Variable: stdout + -- Variable: stdout | Defined to be `(current-output-port)'. - - Variable: stderr + -- Variable: stderr | Defined to be `(current-error-port)'. File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Input, Prev: Standard Formatted I/O, Up: Standard Formatted I/O -Standard Formatted Output -------------------------- +4.3.2 Standard Formatted Output | +------------------------------- | -`(require 'printf)' +`(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. @@ -2887,7 +3437,7 @@ Standard Formatted Output than this, the field is padded (with spaces or zeros per the `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) @@ -2900,7 +3450,7 @@ Standard Formatted Output written for numeric conversions and the maximum field width for string conversions. The precision is specified by a period (`.') followed optionally by a decimal integer (which - defaults to zero if omitted). + defaults to zero if omitted). Alternatively, if the precision is `.*', the next argument in the argument list (before the actual value to be printed) is @@ -2937,8 +3487,8 @@ Standard Formatted Output * A character that specifies the conversion to be applied. -Exact Conversions -................. +4.3.2.1 Exact Conversions | +......................... | `b', `B' Print an integer as an unsigned binary number. @@ -2961,8 +3511,8 @@ Exact Conversions prints using the digits `0123456789abcdef'. `%X' prints using the digits `0123456789ABCDEF'. -Inexact Conversions -................... +4.3.2.2 Inexact Conversions | +........................... | `f' Print a floating-point number in fixed-point notation. @@ -2982,12 +3532,12 @@ Inexact Conversions `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. + after the number, which is scaled accordingly. `%K' outputs a | + dot between number and prefix, `%k' does not. | -Other Conversions -................. +4.3.2.3 Other Conversions | +......................... | `c' Print a single character. The `-' flag is the only one which @@ -3017,18 +3567,18 @@ Other Conversions File: slib.info, Node: Standard Formatted Input, Prev: Standard Formatted Output, Up: Standard Formatted I/O -Standard Formatted Input ------------------------- +4.3.3 Standard Formatted Input | +------------------------------ | -`(require 'scanf)' +`(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. @@ -3176,8 +3726,8 @@ Standard Formatted Input File: slib.info, Node: Programs and Arguments, Next: HTML, Prev: Standard Formatted I/O, Up: Textual Conversion Packages -Program and Arguments -===================== +4.4 Program and Arguments | +========================= | * Menu: @@ -3191,10 +3741,10 @@ Program and Arguments File: slib.info, Node: Getopt, Next: Command Line, Prev: Programs and Arguments, Up: Programs and Arguments -Getopt ------- +4.4.1 Getopt | +------------ | -`(require 'getopt)' +`(require 'getopt)' This routine implements Posix command line argument parsing. Notice that returning values through global variables means that `getopt' is @@ -3212,21 +3762,21 @@ mismatch existed for years in a SLIB `getopt--' example. I have removed the ARGC and ARGV arguments to getopt procedures; and replaced them with a global variable: - - Variable: *argv* + -- Variable: *argv* | Define *ARGV* with a list of arguments before calling getopt procedures. If you don't want the first (0th) element to be ignored, set *OPTIND* to 0 (after requiring getopt). - - Variable: *optind* + -- Variable: *optind* | Is the index of the current element of the command line. It is initially one. In order to parse a new command line or reparse an old one, *OPTIND* must be reset. - - Variable: *optarg* + -- Variable: *optarg* | Is set by getopt to the (string) option-argument of the current option. - - Function: getopt optstring | + -- Function: getopt 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 @@ -3306,13 +3856,13 @@ replaced them with a global variable: (set! *optind* (+ *optind* 1)))) (if (< *optind* (length argv)) (loop (getopt (length argv) argv opts)))) - + (slib:exit) -Getopt-- --------- +4.4.2 Getopt-- | +-------------- | - - Function: `getopt--' optstring | + -- Function: `getopt--' 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' @@ -3348,18 +3898,17 @@ Getopt-- File: slib.info, Node: Command Line, Next: Parameter lists, Prev: Getopt, Up: Programs and Arguments -Command Line ------------- +4.4.3 Command Line | +------------------ | -`(require 'read-command)' +`(require 'read-command)' - - 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 - supported resembles that of popular "shell"s. `read-command' - updates PORT to point to the first character past the command - delimiter. + -- 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 supported | + resembles that of popular "shell"s. `read-command' updates PORT | + to point to the first character past the command delimiter. | If an end of file is encountered in the input before any characters are found that can begin an object or comment, then an @@ -3410,11 +3959,11 @@ Command Line treated as whitespace by `read-dommand-line' and backslashes before <newline>s in comments are also ignored. - - 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 - <newline>s do not terminate reading (only <;> or end of file). + -- 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 <newline>s | + do not terminate reading (only <;> or end of file). | If an end of file is encountered before any characters are found that can begin an object or comment, then an end of file object is @@ -3423,10 +3972,10 @@ Command Line File: slib.info, Node: Parameter lists, Next: Getopt Parameter lists, Prev: Command Line, Up: Programs and Arguments -Parameter lists ---------------- +4.4.4 Parameter lists | +--------------------- | -`(require 'parameters)' +`(require 'parameters)' Arguments to procedures in scheme are distinguished from each other by their position in the procedure call. This can be confusing when a @@ -3442,25 +3991,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. - - Function: remove-parameter parameter-name parameter-list + -- 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 ... + -- 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 @@ -3470,7 +4019,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 @@ -3478,7 +4027,7 @@ 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. @@ -3505,7 +4054,7 @@ of `arities' can be: `nary1' One or more of parameters are acceptable. - - Function: parameter-list->arglist positions arities 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 @@ -3519,13 +4068,13 @@ of `arities' can be: File: slib.info, Node: Getopt Parameter lists, Next: Filenames, Prev: Parameter lists, Up: Programs and Arguments -Getopt Parameter lists ----------------------- +4.4.5 Getopt Parameter lists | +---------------------------- | -`(require 'getopt-parameters)' +`(require 'getopt-parameters)' - - Function: getopt->parameter-list optnames arities types aliases desc - ... + -- Function: getopt->parameter-list optnames arities types aliases | + desc ... | Returns *ARGV* converted to a parameter-list. OPTNAMES are the parameter-names. ARITIES and TYPES are lists of symbols corresponding to OPTNAMES. @@ -3551,7 +4100,7 @@ Getopt Parameter lists In all cases, if unclaimed arguments remain after processing, a warning is signaled and #f is returned. - - Function: getopt->arglist optnames positions arities types + -- Function: getopt->arglist 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, @@ -3589,7 +4138,7 @@ the options (and argument strings DESC ...) are printed to ("Abs" num3)))) -| Usage: cmd [OPTION ARGUMENT ...] ... - + -f, --flag -o, --optional=<number> -n, --nary=<symbols> ... @@ -3599,19 +4148,19 @@ the options (and argument strings DESC ...) are printed to -B -a <num2> ... --Abs=<num3> ... - + ERROR: getopt->parameter-list "unrecognized option" "-?" File: slib.info, Node: Filenames, Next: Batch, Prev: Getopt Parameter lists, Up: Programs and Arguments -Filenames ---------- +4.4.6 Filenames | +--------------- | -`(require 'filename)' or `(require 'glob)' +`(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, @@ -3635,8 +4184,8 @@ Filenames `-' or `]' may be matched by including it as the first or 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 @@ -3662,11 +4211,11 @@ Filenames => "begAmidZend" ((filename:substitute?? "*na*" "?NA?") "banana") => "banaNA" - ((filename:substitute?? "?*?" (lambda (s1 s2 s3) (string-append s3 s1))) | - "ABZ") | + ((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 @@ -3675,28 +4224,28 @@ Filenames (replace-suffix "/usr/local/lib/slib/batch.scm" ".scm" ".c") => "/usr/local/lib/slib/batch.c" - - Function: call-with-tmpnam proc k | - - Function: call-with-tmpnam proc | - 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) | - yielded by the PROC is(are) returned. K may be ommited, in which | - case it defaults to `1'. | - | - - Function: call-with-tmpnam proc suffix1 ... | - Calls PROC with strings returned by successive calls to `tmpnam', | - each with the corresponding SUFFIX string appended. If PROC | - returns, then any files named by the arguments to PROC are deleted | - automatically and the value(s) yielded by the PROC is(are) | - returned. | - | + -- Function: call-with-tmpnam proc k | + -- Function: call-with-tmpnam proc | + 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) + yielded by the PROC is(are) returned. K may be ommited, in which + case it defaults to `1'. + + -- Function: call-with-tmpnam proc suffix1 ... | + Calls PROC with strings returned by successive calls to `tmpnam', + each with the corresponding SUFFIX string appended. If PROC + returns, then any files named by the arguments to PROC are deleted + automatically and the value(s) yielded by the PROC is(are) + returned. + File: slib.info, Node: Batch, Prev: Filenames, Up: Programs and Arguments -Batch ------ +4.4.7 Batch | +----------- | -`(require 'batch)' +`(require 'batch)' The batch procedures provide a way to write and execute portable scripts for a variety of operating systems. Each `batch:' procedure takes as @@ -3725,18 +4274,18 @@ currently uses 2 of these: 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. - - Variable: *operating-system* + -- Variable: *operating-system* | Is batch's best guess as to which operating-system it is running under. `*operating-system*' is set to `(software-type)' (*note 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. @@ -3753,7 +4302,7 @@ added to PARMS or `(copy-tree PARMS)' by the code: (adjoin-parameters! PARMS (list 'batch-port PORT)) - - Function: batch:command parms string1 string2 ... + -- Function: batch:command parms string1 string2 ... | Calls `batch:try-command' (below) with arguments, but signals an error if `batch:try-command' returns `#f'. @@ -3761,11 +4310,11 @@ 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 + -- Function: batch:try-chopped-command parms arg1 arg2 ... list | breaks the last argument LIST into chunks small enough so that the command: @@ -3777,34 +4326,34 @@ translated into the batch dialect and `#f' if not. In the case of 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: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). - - 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. @@ -3812,22 +4361,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!'. @@ -3841,12 +4390,12 @@ Here is an example of the use of most of batch's procedures: (define batch (create-database #f 'alist-table)) (batch:initialize! batch) - + (define my-parameters (list (list 'batch-dialect (os->batch-dialect *operating-system*)) (list 'operating-system *operating-system*) (list 'batch-port (current-output-port)))) ;gets filled in later - + (batch:call-with-output-script my-parameters "my-batch" @@ -3903,34 +4452,34 @@ When run, `my-batch' prints: File: slib.info, Node: HTML, Next: HTML Tables, Prev: Programs and Arguments, Up: Textual Conversion Packages -HTML -==== +4.5 HTML | +======== | -`(require 'html-form)' +`(require 'html-form)' - - Function: html:atval txt + -- Function: html:atval txt | Returns a string with character substitutions appropriate to send - TXT as an "attribute-value". + TXT as an "attribute-value". - - Function: html:plain txt + -- Function: html:plain txt | Returns a string with character substitutions appropriate to send - TXT as an "plain-text". + TXT as an "plain-text". - - Function: html:meta name content + -- 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 + -- 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 + -- 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 @@ -3938,67 +4487,66 @@ HTML 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 + -- 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 ... + -- 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: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 ... + -- Function: html:comment line1 line ... | Returns the strings LINE1 as HTML comments. -HTML Forms -========== +4.6 HTML Forms | +============== | - - Function: html:form method action body ... + -- 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". + `html:form' returns the HTML "form". - - Function: html:hidden name value + -- Function: html:hidden name value | Returns HTML string which will cause NAME=VALUE in form. - - Function: html:checkbox pname default + -- Function: html:checkbox pname default | Returns HTML string for check box. - - Function: html:text pname default size ... + -- Function: html:text pname default size ... | Returns HTML string for one-line text box. - - Function: html:text-area pname default-list + -- Function: html:text-area pname default-list | Returns HTML string for multi-line text box. - - Function: html:select pname arity default-list foreign-values + -- 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 + -- 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 + -- 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 + -- 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:reset | + Returns a string which generates a "reset" button. - - Function: form:element pname arity default-list foreign-values + -- 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 @@ -4037,19 +4585,19 @@ HTML Forms `nary1' text area - - Function: form:delimited pname doc aliat arity default-list + -- 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: html:delimited-list row ... | - Wraps its arguments with delimited-list (`DL' command. | - | - - Function: get-foreign-choices tab | - Returns a list of the `visible-name' or first fields of table TAB. | - | - - Function: command->p-specs rdb command-table command + -- Function: html:delimited-list row ... | + Wraps its arguments with delimited-list (`DL' command. + + -- Function: get-foreign-choices tab | + Returns a list of the `visible-name' or first fields of table TAB. + + -- 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. @@ -4084,25 +4632,25 @@ HTML Forms File: slib.info, Node: HTML Tables, Next: HTTP and CGI, Prev: HTML, Up: Textual Conversion Packages -HTML Tables -=========== +4.7 HTML Tables | +=============== | -`(require 'db->html)' +`(require 'db->html)' - - Function: html:table options row ... + -- Function: html:table options row ... | - - Function: html:caption caption align - - Function: html:caption caption + -- 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 uris + -- Function: html:href-heading columns uris | Outputs a heading row with column-names COLUMNS linked to URIs URIS. - - Function: html:linked-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. @@ -4111,28 +4659,29 @@ HTML Tables 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->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. + -- Function: table->linked-html caption db table-name match-key1 ... | + Returns HTML string for DB table TABLE-NAME chopped into 50-row | + HTML tables. 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->linked-page db table-name index-filename arg ... + -- 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. The optional ARGS ... arguments restrict actions to a subset of the table. *Note match-key: Table Operations. - - Function: catalog->html db caption arg ... + -- Function: catalog->html db caption arg ... | Returns HTML string for the catalog table of DB. -HTML editing tables -------------------- +4.7.1 HTML editing tables | +------------------------- | 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 @@ -4165,11 +4714,11 @@ The behavior of edited rows is: After any change to the table, a `sync-database' of the database is performed. - - Function: command:modify-table table-name null-keys update delete + -- 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 + -- 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 indicating the row is to be deleted when any matches its corresponding primary @@ -4177,7 +4726,7 @@ performed. the `row:update', `row:delete', and `row:retrieve' of TABLE-NAME in DB. - - Function: command:make-editable-table rdb table-name arg ... + -- 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 @@ -4195,7 +4744,7 @@ performed. `+' have arity `nary1'. - - Function: html:editable-row-converter k names edit-point + -- 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. @@ -4213,10 +4762,10 @@ performed. `row->anchor'). The page so referenced typically allows the user to edit fields of that row. -HTML databases --------------- +4.7.2 HTML databases | +-------------------- | - - Function: db->html-files db dir index-filename caption + -- 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. @@ -4226,8 +4775,8 @@ HTML databases 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 + -- 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 @@ -4237,8 +4786,8 @@ HTML databases 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 + -- Function: db->netscape db dir index-filename | + -- Function: db->netscape db dir | `db->netscape' is just like `db->html-directory', but calls `browse-url' with the uri for the top page after the pages are created. @@ -4246,39 +4795,39 @@ HTML databases File: slib.info, Node: HTTP and CGI, Next: Parsing HTML, Prev: HTML Tables, Up: Textual Conversion Packages -HTTP and CGI -============ +4.8 HTTP and CGI | +================ | -`(require 'http)' or `(require 'cgi)' +`(require 'http)' or `(require 'cgi)' - - Function: http:header alist + -- 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 ... + -- Function: http:content alist body ... | Returns the concatenation of strings BODY with the `(http:header ALIST)' and the `Content-Length' prepended. - - Variable: *http:byline* + -- Variable: *http:byline* | String appearing at the bottom of error pages. - - Function: http:error-page status-code reason-phrase html-string ... + -- 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 + -- Function: http:forwarding-page title dly uri html-string ... | + The string or symbol TITLE is the page title. DLY 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 + automatically forwards to URI after DLY 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 + -- 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, @@ -4311,7 +4860,7 @@ HTTP and CGI (close-port port))) (lambda () (close-port socket)))) - - Function: cgi:serve-query serve-proc + -- 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 @@ -4328,8 +4877,8 @@ HTTP and CGI 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 + -- 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 @@ -4345,12 +4894,12 @@ HTTP and CGI File: slib.info, Node: Parsing HTML, Next: URI, Prev: HTTP and CGI, Up: Textual Conversion Packages -Parsing HTML -============ +4.9 Parsing HTML | +================ | -`(require 'html-for-each)' +`(require 'html-for-each)' - - Function: html-for-each file word-proc markup-proc white-proc + -- Function: html-for-each file word-proc markup-proc white-proc | newline-proc FILE is an input port or a string naming an existing file containing HTML text. WORD-PROC is a procedure of one argument or @@ -4385,8 +4934,8 @@ Parsing HTML `html-for-each' returns an unspecified value. - - Function: html:read-title file limit - - Function: html:read-title file + -- Function: html:read-title file limit | + -- Function: html:read-title file | FILE is an input port or a string naming an existing file containing HTML text. If supplied, LIMIT must be an integer. LIMIT defaults to 1000. @@ -4399,7 +4948,7 @@ Parsing HTML from FILE is not `#\<', or if the end of title is not found within the first (approximately) LIMIT words. - - Function: htm-fields htm + -- Function: htm-fields htm | HTM is a hypertext markup string. If HTM is a (hypertext) comment, then `htm-fields' returns #f. @@ -4412,27 +4961,27 @@ Parsing HTML File: slib.info, Node: URI, Next: Printing Scheme, Prev: Parsing HTML, Up: Textual Conversion Packages -URI -=== +4.10 URI | +======== | -`(require '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 + -- 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: uri:make-path path | - Returns a URI string combining the components of list PATH. | - | - - Function: html:anchor name + -- Function: uri:make-path path | + Returns a URI string combining the components of list PATH. + + -- 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. @@ -4440,23 +4989,23 @@ Implements "Uniform Resource Identifiers" (URI) as described in RFC => "<A NAME=\"(section%207)\"></A>" - - Function: html:link uri highlighted + -- Function: html:link uri highlighted | Returns a string which links the HIGHLIGHTED text to 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.). + -- 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.). | - - Function: html:isindex prompt + -- 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.). - - Function: uri->tree uri-reference base-tree - - Function: uri->tree uri-reference + -- Function: uri->tree uri-reference base-tree | + -- Function: uri->tree uri-reference | 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. @@ -4475,57 +5024,57 @@ Implements "Uniform Resource Identifiers" (URI) as described in RFC => (http "www.ics.uci.edu" ("" "pub" "ietf" "uri" "") #f "Related") - - Function: uri:split-fields txt chr | - Returns a list of TXT split at each occurrence of CHR. CHR does | - not appear in the returned list of strings. | - | - - Function: uri:decode-query query-string - Converts a "URI" encoded QUERY-STRING to a query-alist. + -- Function: uri:split-fields txt chr | + Returns a list of TXT split at each occurrence of CHR. CHR does + not appear in the returned list of strings. + + -- Function: uri:decode-query query-string | + Converts a "URI" encoded QUERY-STRING to a query-alist. `uric:' prefixes indicate procedures dealing with URI-components. - - Function: uric:encode uri-component allows + -- 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'. + octets (as defined in RFC 2396) have been `%' "escaped". `uric:decode' | + decodes strings encoded by `uric:encode'. | - - Function: uric:decode uri-component + -- 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. - - Function: uri:path->keys path-list ptypes | - PATH-LIST is a path-list as returned by `uri:split-fields'. | - `uri:path->keys' returns a list of items returned by | - `uri:decode-path', coerced to types PTYPES. | - | + -- Function: uri:path->keys path-list ptypes | + PATH-LIST is a path-list as returned by `uri:split-fields'. + `uri:path->keys' returns a list of items returned by + `uri:decode-path', coerced to types PTYPES. + File-system Locators and Predicates ----------------------------------- - - Function: path->uri path + -- Function: path->uri path | Returns a URI-string for PATH on the local host. - - Function: absolute-uri? str + -- Function: absolute-uri? str | Returns #t if STR is an absolute-URI as indicated by a syntactically valid (per RFC 2396) "scheme"; 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: null-directory? str + -- Function: null-directory? str | Returns #t if changing directory to STR would leave the current directory unchanged; 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 `['. Before RFC 2396, the "File Transfer Protocol" (FTP) served a similar purpose. - - Function: parse-ftp-address uri + -- 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 @@ -4542,8 +5091,8 @@ purpose. File: slib.info, Node: Printing Scheme, Next: Time and Date, Prev: URI, Up: Textual Conversion Packages -Printing Scheme -=============== +4.11 Printing Scheme | +==================== | * Menu: @@ -4554,10 +5103,10 @@ Printing Scheme File: slib.info, Node: Generic-Write, Next: Object-To-String, Prev: Printing Scheme, Up: Printing Scheme -Generic-Write -------------- +4.11.1 Generic-Write | +-------------------- | -`(require 'generic-write)' +`(require 'generic-write)' `generic-write' is a procedure that transforms a Scheme data value (or Scheme program expression) into its textual representation and @@ -4565,7 +5114,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. @@ -4590,7 +5139,6 @@ printing, output to a string and truncated output. Examples: (write obj) == (generic-write obj #f #f DISPLAY-STRING) (display obj) == (generic-write obj #t #f DISPLAY-STRING) - where DISPLAY-STRING == (lambda (s) (for-each write-char (string->list s)) #t) @@ -4598,28 +5146,28 @@ printing, output to a string and truncated output. File: slib.info, Node: Object-To-String, Next: Pretty-Print, Prev: Generic-Write, Up: Printing Scheme -Object-To-String ----------------- +4.11.2 Object-To-String | +----------------------- | -`(require 'object->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. File: slib.info, Node: Pretty-Print, Prev: Object-To-String, Up: Printing Scheme -Pretty-Print ------------- +4.11.3 Pretty-Print | +------------------- | -`(require '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. @@ -4632,8 +5180,8 @@ Pretty-Print -| (16 17 18 19 20) -| (21 22 23 24 25)) - - Procedure: pretty-print->string obj - - Procedure: pretty-print->string obj width + -- 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. @@ -4670,16 +5218,16 @@ Pretty-Print 25)) " - `(require 'pprint-file)' + `(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. @@ -4704,14 +5252,15 @@ thus can reduce loading time. The following will write into File: slib.info, Node: Time and Date, Next: NCBI-DNA, Prev: Printing Scheme, Up: Textual Conversion Packages -Time and Date -============= +4.12 Time and Date | +================== | * Menu: * Time Zone:: * Posix Time:: 'posix-time * Common-Lisp Time:: 'common-lisp-time +* Time Infrastructure:: | If `(provided? 'current-time)': @@ -4719,29 +5268,29 @@ The procedures `current-time', `difftime', and `offset-time' deal with a "calendar time" datatype which may or may not be disjoint from other Scheme datatypes. - - Function: current-time + -- Function: current-time | Returns the time since 00:00:00 GMT, January 1, 1970, measured in seconds. Note that the reference time is different from the 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)'. File: slib.info, Node: Time Zone, Next: Posix Time, Prev: Time and Date, Up: Time and Date -Time Zone ---------- +4.12.1 Time Zone | +---------------- | (require 'time-zone) - - Data Format: TZ-string + -- Data Format: TZ-string | POSIX standards specify several formats for encoding time-zone rules. @@ -4795,17 +5344,17 @@ Time Zone Day 0 is a Sunday. - - Data Type: time-zone + -- Data Type: time-zone | is a datatype encoding how many hours from Greenwich Mean Time the 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 @@ -4821,21 +5370,21 @@ Time Zone made of any timezone at any calendar time. - - Function: tz:std-offset tz | - TZ is a time-zone object. `tz:std-offset' returns the number of | - seconds west of the Prime Meridian timezone TZ is. | - | - | + -- Function: tz:std-offset tz | + TZ is a time-zone object. `tz:std-offset' returns the number of + seconds west of the Prime Meridian timezone TZ is. + + The rest of these procedures and variables are provided for POSIX compatability. Because of shared state they are not thread-safe. - - Function: tzset + -- 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. @@ -4843,19 +5392,19 @@ compatability. Because of shared state they are not thread-safe. This function is automatically called by the time conversion procedures which depend on the time zone (*note Time and Date::). - - Variable: *timezone* + -- Variable: *timezone* | Contains the difference, in seconds, between Greenwich Mean Time and local standard time (for example, in the U.S. Eastern time zone (EST), timezone is 5*60*60). `*timezone*' is initialized by `tzset'. - - Variable: daylight? + -- Variable: daylight? | is `#t' if the default timezone has rules for "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. - - Variable: tzname + -- Variable: tzname | is a vector of strings. Index 0 has the abbreviation for the standard timezone; If DAYLIGHT?, then index 1 has the abbreviation for the Daylight Savings timezone. @@ -4863,15 +5412,16 @@ compatability. Because of shared state they are not thread-safe. File: slib.info, Node: Posix Time, Next: Common-Lisp Time, Prev: Time Zone, Up: Time and Date -Posix Time ----------- +4.12.2 Posix Time | +----------------- | (require 'posix-time) - - - Data Type: Calendar-Time + + | + -- Data Type: Calendar-Time | is a datatype encapsulating time. - - Data Type: Coordinated Universal Time + -- Data Type: Coordinated Universal Time | (abbreviated "UTC") is a vector of integers representing time: 0. seconds (0 - 61) @@ -4894,13 +5444,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 @@ -4908,44 +5458,44 @@ 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. -File: slib.info, Node: Common-Lisp Time, Prev: Posix Time, Up: Time and Date - -Common-Lisp Time ----------------- +File: slib.info, Node: Common-Lisp Time, Next: Time Infrastructure, Prev: Posix Time, Up: Time and Date + | +4.12.3 Common-Lisp Time | +----------------------- | - - Function: get-decoded-time + -- Function: get-decoded-time | Equivalent to `(decode-universal-time (get-universal-time))'. - - Function: get-universal-time + -- Function: get-universal-time | Returns the current time as "Universal Time", number of seconds 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) @@ -4970,8 +5520,8 @@ 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 + -- 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 @@ -4982,32 +5532,48 @@ Common-Lisp Time match the arguments to `encode-universal-time'. +File: slib.info, Node: Time Infrastructure, Prev: Common-Lisp Time, Up: Time and Date + | +4.12.4 Time Infrastructure | +-------------------------- | + | +`(require 'time-core)' | + | + -- Function: time:gmtime tm | + -- Function: time:invert decoder target | + -- Function: time:split t tm_isdst tm_gmtoff tm_zone | + | + `(require 'tzfile)' | + | + -- Function: tzfile:read path | + | + File: slib.info, Node: NCBI-DNA, Next: Schmooz, Prev: Time and Date, Up: Textual Conversion Packages + | +4.13 NCBI-DNA | +============= | -NCBI-DNA -======== - - - Function: ncbi:read-dna-sequence port + -- Function: ncbi:read-dna-sequence port | Reads the NCBI-format DNA sequence following the word `ORIGIN' from PORT. - - Function: ncbi:read-file file + -- Function: ncbi:read-file file | Reads the NCBI-format DNA sequence following the word `ORIGIN' from FILE. - - Function: mrna<-cdna str + -- Function: mrna<-cdna str | Replaces `T' with `U' in STR - - Function: codons<-cdna cdna + -- Function: codons<-cdna cdna | Returns a list of three-letter symbol codons comprising the protein sequence encoded by CDNA starting with its first occurence of `atg'. - - Function: protein<-cdna cdna + -- Function: protein<-cdna cdna | Returns a list of three-letter symbols for the protein sequence encoded by CDNA starting with its first occurence of `atg'. - - Function: p<-cdna cdna + -- Function: p<-cdna cdna | Returns a string of one-letter amino acid codes for the protein sequence encoded by CDNA starting with its first occurence of `atg'. @@ -5015,18 +5581,18 @@ NCBI-DNA These cDNA count routines provide a means to check the nucleotide sequence with the `BASE COUNT' line preceding the sequence from NCBI. - - Function: cdna:base-count cdna + -- Function: cdna:base-count cdna | Returns a list of counts of `a', `c', `g', and `t' occurrencing in CDNA. - - Function: cdna:report-base-count cdna + -- Function: cdna:report-base-count cdna | Prints the counts of `a', `c', `g', and `t' occurrencing in CDNA. File: slib.info, Node: Schmooz, Prev: NCBI-DNA, Up: Textual Conversion Packages -Schmooz -======= +4.14 Schmooz | +============ | "Schmooz" is a simple, lightweight markup language for interspersing Texinfo documentation with Scheme source code. Schmooz does not create @@ -5037,16 +5603,16 @@ imported into the documentation using the Texinfo command `@include'. process files. Files containing schmooz documentation should not contain `(require 'schmooz)'. - - Procedure: schmooz filename.scm ... + -- Procedure: schmooz filename.scm ... | FILENAME.scm should be a string ending with `.scm' naming an existing file containing Scheme source code. `schmooz' extracts top-level comments containing schmooz commands from FILENAME.scm and writes the converted Texinfo source to a file named FILENAME.txi. - - Procedure: schmooz filename.texi ... - - Procedure: schmooz filename.tex ... - - Procedure: schmooz filename.txi ... + -- Procedure: schmooz filename.texi ... | + -- Procedure: schmooz filename.tex ... | + -- Procedure: schmooz filename.txi ... | FILENAME should be a string naming an existing file containing Texinfo source code. For every occurrence of the string `@include FILENAME.txi' within that file, `schmooz' calls itself with the @@ -5105,7 +5671,7 @@ remainder of the line, separated by whitespace. Will result in: @defun myfun arg1 args @dots{} - + @code{myfun} takes argument @var{arg1} and any number of @var{args} @end defun @@ -5124,8 +5690,8 @@ directives in schmooz comments. File: slib.info, Node: Mathematical Packages, Next: Database Packages, Prev: Textual Conversion Packages, Up: Top -Mathematical Packages -********************* +5 Mathematical Packages | +*********************** | * Menu: @@ -5135,7 +5701,7 @@ Mathematical Packages * Random Numbers:: 'random * Fast Fourier Transform:: 'fft * Cyclic Checksum:: 'crc -* Graphing:: | +* Graphing:: * Solid Modeling:: VRML97 * Color:: * Root Finding:: 'root @@ -5146,10 +5712,10 @@ Mathematical Packages File: slib.info, Node: Bit-Twiddling, Next: Modular Arithmetic, Prev: Mathematical Packages, Up: Mathematical Packages -Bit-Twiddling -============= +5.1 Bit-Twiddling | +================= | -`(require 'logical)' +`(require 'logical)' The bit-twiddling functions are made available through the use of the `logical' package. `logical' is loaded by inserting `(require @@ -5157,35 +5723,39 @@ The bit-twiddling functions are made available through the use of the behave as though operating on integers in two's-complement representation. -Bitwise Operations ------------------- +5.1.1 Bitwise Operations | +------------------------ | - - Function: logand n1 n1 - Returns the integer which is the bit-wise AND of the two integer + -- Function: logand n1 ... | + -- Function: bitwise-and n1 ... | + Returns the integer which is the bit-wise AND of the integer | arguments. Example: (number->string (logand #b1100 #b1010) 2) => "1000" - - Function: logior n1 n2 - Returns the integer which is the bit-wise OR of the two integer + -- Function: logior n1 ... | + -- Function: bitwise-ior n1 ... | + Returns the integer which is the bit-wise OR of the integer | arguments. Example: (number->string (logior #b1100 #b1010) 2) => "1110" - - Function: logxor n1 n2 - Returns the integer which is the bit-wise XOR of the two integer + -- Function: logxor n1 ... | + -- Function: bitwise-xor n1 ... | + Returns the integer which is the bit-wise XOR of the integer | arguments. Example: (number->string (logxor #b1100 #b1010) 2) => "110" - - Function: lognot n - Returns the integer which is the 2s-complement of the integer + -- Function: lognot n | + -- Function: bitwise-not n | + Returns the integer which is the one's-complement of the integer | argument. Example: @@ -5194,19 +5764,25 @@ Bitwise Operations (number->string (lognot #b0) 2) => "-1" - - Function: bitwise-if mask n0 n1 + -- Function: bitwise-if mask n0 n1 | + -- Function: bitwise-merge 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 | + -- Function: any-bits-set? j k | (logtest j k) == (not (zero? (logand j k))) - + (logtest #b0100 #b1011) => #f (logtest #b0100 #b0111) => #t - - Function: logcount n +5.1.2 Integer Properties | +------------------------ | + | + -- Function: logcount n | + -- Function: bit-count 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 @@ -5220,19 +5796,63 @@ Bitwise Operations (logcount -2) => 1 -Bit Within Word ---------------- + -- Function: integer-length n | + Returns the number of bits neccessary to represent N. | + + Example: | + (integer-length #b10101010) | + => 8 | + (integer-length 0) | + => 0 | + (integer-length #b1111) | + => 4 | + | + -- Function: log2-binary-factors n | + -- Function: first-set-bit n | + Returns the number of factors of two of integer N. This value is | + also the bit-index of the least-significant `1' bit in N. | + | + (require 'printf) | + (do ((idx 0 (+ 1 idx))) | + ((> idx 16)) | + (printf "%s(%3d) ==> %-5d %s(%2d) ==> %-5d\n" | + 'log2-binary-factors | + (- idx) (log2-binary-factors (- idx)) | + 'log2-binary-factors | + idx (log2-binary-factors idx))) | + -| | + log2-binary-factors( 0) ==> -1 log2-binary-factors( 0) ==> -1 | + log2-binary-factors( -1) ==> 0 log2-binary-factors( 1) ==> 0 | + log2-binary-factors( -2) ==> 1 log2-binary-factors( 2) ==> 1 | + log2-binary-factors( -3) ==> 0 log2-binary-factors( 3) ==> 0 | + log2-binary-factors( -4) ==> 2 log2-binary-factors( 4) ==> 2 | + log2-binary-factors( -5) ==> 0 log2-binary-factors( 5) ==> 0 | + log2-binary-factors( -6) ==> 1 log2-binary-factors( 6) ==> 1 | + log2-binary-factors( -7) ==> 0 log2-binary-factors( 7) ==> 0 | + log2-binary-factors( -8) ==> 3 log2-binary-factors( 8) ==> 3 | + log2-binary-factors( -9) ==> 0 log2-binary-factors( 9) ==> 0 | + log2-binary-factors(-10) ==> 1 log2-binary-factors(10) ==> 1 | + log2-binary-factors(-11) ==> 0 log2-binary-factors(11) ==> 0 | + log2-binary-factors(-12) ==> 2 log2-binary-factors(12) ==> 2 | + log2-binary-factors(-13) ==> 0 log2-binary-factors(13) ==> 0 | + log2-binary-factors(-14) ==> 1 log2-binary-factors(14) ==> 1 | + log2-binary-factors(-15) ==> 0 log2-binary-factors(15) ==> 0 | + log2-binary-factors(-16) ==> 4 log2-binary-factors(16) ==> 4 | + | +5.1.3 Bit Within Word | +--------------------- | + | + -- Function: logbit? index n | + -- Function: bit-set? index n | + (logbit? index n) == (logtest (expt 2 index) n) | - - Function: logbit? index j - (logbit? index j) == (logtest (integer-expt 2 index) j) - (logbit? 0 #b1101) => #t (logbit? 1 #b1101) => #f (logbit? 2 #b1101) => #t (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'. @@ -5241,36 +5861,36 @@ Bit Within Word (number->string (copy-bit 2 0 #t) 2) => "100" (number->string (copy-bit 2 #b1111 #f) 2) => "1011" -Fields of Bits --------------- +5.1.4 Field of Bits | +------------------- | - - Function: logical:ones n | - Returns the smallest non-negative integer having N binary ones. | - | - - 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. - | + Example: (number->string (bit-field #b1101101010 0 4) 2) => "1010" (number->string (bit-field #b1101101010 4 9) 2) => "10110" - - Function: copy-bit-field to start end from + -- Function: copy-bit-field to from start end | 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 the result. Example: - (number->string (copy-bit-field #b1101101010 0 4 0) 2) + (number->string (copy-bit-field #b1101101010 0 0 4) 2) | => "1101100000" - (number->string (copy-bit-field #b1101101010 0 4 -1) 2) + (number->string (copy-bit-field #b1101101010 -1 0 4) 2) | => "1101101111" + (number->string (copy-bit-field #b110100100010000 -1 5 9) 2) | + => "110100111110000" | - - Function: ash n count + -- Function: ash n count | + -- Function: arithmetic-shift n count | Returns an integer equivalent to `(inexact->exact (floor (* N (expt 2 COUNT))))'. @@ -5280,53 +5900,36 @@ Fields of Bits (number->string (ash #b1010 -1) 2) => "101" - - Function: integer-length n - Returns the number of bits neccessary to represent N. + -- Function: rotate-bit-field n count start end | + Returns N with the bit-field from START to END cyclically permuted | + by COUNT bits towards high-order. | Example: - (integer-length #b10101010) - => 8 - (integer-length 0) - => 0 - (integer-length #b1111) - => 4 - - - Function: integer-expt n k - Returns N raised to the non-negative integer exponent K. - - Example: - (integer-expt 2 5) - => 32 - (integer-expt -3 3) - => -27 - -Bit order and Lamination ------------------------- - - - Function: logical:rotate k count len - Returns the low-order LEN bits of K cyclically permuted COUNT bits - towards high-order. - - Example: - (number->string (logical:rotate #b0100 3 4) 2) - => "10" - (number->string (logical:rotate #b0100 -1 4) 2) - => "10" - - - Function: bit-reverse k n - Returns the low-order K bits of N with the bit order reversed. - The low-order bit of N is the high order bit of the returned value. - - (number->string (bit-reverse 8 #xa7) 16) + (number->string (rotate-bit-field #b0100 3 0 4) 2) | + => "10" + (number->string (rotate-bit-field #b0100 -1 0 4) 2) | + => "10" + (number->string (rotate-bit-field #b110100100010000 -1 5 9) 2) | + => "110100010010000" | + (number->string (rotate-bit-field #b110100100010000 1 5 9) 2) | + => "110100000110000" | + + -- Function: reverse-bit-field n start end | + Returns N with the order of bits START to END reversed. | + + (number->string (reverse-bit-field #xa7 0 8) 16) | => "e5" - - Function: integer->list k len - - Function: integer->list k +5.1.5 Bits as Booleans | +---------------------- | + | + -- Function: integer->list k len | + -- Function: integer->list k | `integer->list' returns a list of LEN booleans corresponding to each bit of the given integer. #t is coded for each 1; #f for 0. The LEN argument defaults to `(integer-length K)'. - - Function: list->integer list + -- Function: list->integer list | `list->integer' returns an integer formed from the booleans in the list LIST, which must be a list of booleans. A 1 bit is coded for each #t; a 0 bit for #f. @@ -5334,67 +5937,19 @@ Bit order and Lamination `integer->list' and `list->integer' are inverses so far as `equal?' is concerned. - - Function: booleans->integer bool1 ... + -- Function: booleans->integer bool1 ... | Returns the integer coded by the BOOL1 ... arguments. - - - Function: bitwise:laminate k1 ... - Returns an integer composed of the bits of K1 ... interlaced in - argument order. Given K1, ... KN, the n low-order bits of the - returned value will be the lowest-order bit of each argument. - - - Function: bitwise:delaminate count k - Returns a list of COUNT integers comprised of every COUNTh bit of - the integer K. - - For any non-negative integers K and COUNT: - (eqv? k (bitwise:laminate (bitwise:delaminate count k))) - -Gray code ---------- - -A "Gray code" is an ordering of non-negative integers in which exactly -one bit differs between each pair of successive elements. There are -multiple Gray codings. An n-bit Gray code corresponds to a Hamiltonian -cycle on an n-dimensional hypercube. - -Gray codes find use communicating incrementally changing values between -asynchronous agents. De-laminated Gray codes comprise the coordinates -of Peano-Hilbert space-filling curves. - - - Function: integer->gray-code k - Converts K to a Gray code of the same `integer-length' as K. - - - Function: gray-code->integer k - Converts the Gray code K to an integer of the same - `integer-length' as K. - - For any non-negative integer K, - (eqv? k (gray-code->integer (integer->gray-code k))) - - - Function: = k1 k2 - - Function: gray-code<? k1 k2 - - Function: gray-code>? k1 k2 - - Function: gray-code<=? k1 k2 - - Function: gray-code>=? k1 k2 - These procedures return #t if their Gray code arguments are - (respectively): equal, monotonically increasing, monotonically - decreasing, monotonically nondecreasing, or monotonically - nonincreasing. - - For any non-negative integers K1 and K2, the Gray code predicate - of `(integer->gray-code k1)' and `(integer->gray-code k2)' will - return the same value as the corresponding predicate of K1 and K2. - + | File: slib.info, Node: Modular Arithmetic, Next: Prime Numbers, Prev: Bit-Twiddling, Up: Mathematical Packages -Modular Arithmetic -================== +5.2 Modular Arithmetic | +====================== | -`(require 'modular)' +`(require 'modular)' - - Function: mod x1 x2 - - Function: rem x1 x2 + -- Function: mod x1 x2 | + -- Function: rem x1 x2 | These procedures implement the Common-Lisp functions of the same names. The real number X2 must be non-zero. `mod' returns `(- X1 (* X2 (floor (/ X1 X2))))'. `rem' returns `(- X1 (* X2 (truncate @@ -5405,25 +5960,25 @@ Modular Arithmetic (mod -90 360) => 270 (rem -90 180) => -90 - + (mod 540 360) => 180 (rem 540 360) => 180 - + (mod (* 5/2 pi) (* 2 pi)) => 1.5707963267948965 (rem (* -5/2 pi) (* 2 pi)) => -1.5707963267948965 - - 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. @@ -5439,46 +5994,46 @@ For all of these functions, if the first argument (MODULUS) is: `negative?' The arguments and result are treated as members of the integers - modulo `(+ 1 (* -2 MODULUS))', but with "symmetric" - representation; i.e. `(<= (- MODULUS) N MODULUS)'. + modulo `(+ 1 (* -2 MODULUS))', but with "symmetric" representation; | + i.e. `(<= (- MODULUS) N MODULUS)'. | 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 n2 + -- Function: modular:invert modulus n2 | Returns an integer n such that 1 = (n * N2) mod MODULUS. If N2 has no inverse mod MODULUS an error is signaled. - - Function: modular:negate modulus n2 + -- Function: modular:negate modulus n2 | Returns (-N2) mod MODULUS. - - Function: modular:+ modulus n2 n3 + -- Function: modular:+ modulus n2 n3 | Returns (N2 + N3) mod MODULUS. - - Function: modular:- modulus n2 n3 + -- Function: modular:- modulus n2 n3 | Returns (N2 - N3) mod MODULUS. - - Function: modular:* modulus n2 n3 + -- Function: modular:* modulus n2 n3 | Returns (N2 * N3) mod MODULUS. The Scheme code for `modular:*' with negative MODULUS is not completed for fixnum-only implementations. - - Function: modular:expt modulus n2 n3 + -- Function: modular:expt modulus n2 n3 | Returns (N2 ^ N3) mod MODULUS. File: slib.info, Node: Prime Numbers, Next: Random Numbers, Prev: Modular Arithmetic, Up: Mathematical Packages -Prime Numbers -============= +5.3 Prime Numbers | +================= | -`(require 'factor)' +`(require 'factor)' - - Variable: prime:prngs + -- 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 @@ -5489,28 +6044,28 @@ 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. - - Variable: prime:trials + -- Variable: prime:trials | 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) <)'. @@ -5518,37 +6073,37 @@ the Solovay-Strassen primality test. See File: slib.info, Node: Random Numbers, Next: Fast Fourier Transform, Prev: Prime Numbers, Up: Mathematical Packages -Random Numbers -============== +5.4 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. +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://swiss.csail.mit.edu/ftpdir/users/jaffer/diehard.c.pat' corrects. | - SLIB's PRNG generates 8 bits at a time. With the degenerate seed | + SLIB's 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. -* Menu: | - | -* Exact Random Numbers:: 'random | -* Inexact Random Numbers:: 'random-inexact | - | +* Menu: + +* Exact Random Numbers:: 'random +* Inexact Random Numbers:: 'random-inexact + File: slib.info, Node: Exact Random Numbers, Next: Inexact Random Numbers, Prev: Random Numbers, Up: Random Numbers - | -Exact Random Numbers | --------------------- | - | -`(require 'random)' | - | - - Function: random n state - - Function: random n | - N must be an exact positive integer. `random' returns an exact | - integer between zero (inclusive) and N (exclusive). The values | + +5.4.1 Exact Random Numbers | +-------------------------- | + +`(require 'random)' + + -- Function: random n state | + -- Function: random n | + N must be an exact positive integer. `random' returns an exact + integer between zero (inclusive) and N (exclusive). The values returned by `random' are uniformly distributed from 0 to N. The optional argument STATE must be of the type returned by @@ -5557,7 +6112,7 @@ Exact Random Numbers | to maintain the state of the pseudo-random-number generator and is altered as a side effect of calls to `random'. - - Variable: *random-state* + -- Variable: *random-state* | Holds a data structure that encodes the internal state of the random-number generator that `random' uses by default. The nature of this data structure is implementation-dependent. It may be @@ -5565,13 +6120,13 @@ Exact Random Numbers | 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 + -- 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 @@ -5580,8 +6135,8 @@ Exact Random Numbers | Calling `seed->random-state' with unequal arguments will nearly always return unequal states. - - Function: make-random-state - - Function: make-random-state obj + -- Function: make-random-state | + -- 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 @@ -5591,44 +6146,44 @@ Exact Random Numbers | File: slib.info, Node: Inexact Random Numbers, Prev: Exact Random Numbers, Up: Random Numbers - | -Inexact Random Numbers | ----------------------- | - | -`(require 'random-inexact)' | - - Function: random:uniform - - Function: random:uniform state +5.4.2 Inexact Random Numbers | +---------------------------- | + +`(require 'random-inexact)' + + -- Function: random:uniform | + -- 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 | + -- 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 | + -- 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)))'. - - Procedure: random:normal-vector! vect | - - Procedure: random:normal-vector! vect state | + -- Procedure: random:normal-vector! vect | + -- Procedure: 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). - - Procedure: random:hollow-sphere! vect | - - Procedure: random:hollow-sphere! vect state | + -- Procedure: random:hollow-sphere! vect | + -- Procedure: 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. - - Procedure: random:solid-sphere! vect | - - Procedure: random:solid-sphere! vect state | + -- Procedure: random:solid-sphere! vect | + -- Procedure: 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 @@ -5638,43 +6193,41 @@ Inexact Random Numbers | File: slib.info, Node: Fast Fourier Transform, Next: Cyclic Checksum, Prev: Random Numbers, Up: Mathematical Packages -Fast Fourier Transform -====================== +5.5 Fast Fourier Transform | +========================== | -`(require 'fft)' +`(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. + 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. `(fft-1 (fft ARRAY))' will return an array of values close to ARRAY. (fft '#(1 0+i -1 0-i 1 0+i -1 0-i)) => - + #(0.0 0.0 0.0+628.0783185208527e-18i 0.0 0.0 0.0 8.0-628.0783185208527e-18i 0.0) - + (fft-1 '#(0 0 0 0 0 0 8 0)) => - + #(1.0 -61.23031769111886e-18+1.0i -1.0 61.23031769111886e-18-1.0i 1.0 -61.23031769111886e-18+1.0i -1.0 61.23031769111886e-18-1.0i) File: slib.info, Node: Cyclic Checksum, Next: Graphing, Prev: Fast Fourier Transform, Up: Mathematical Packages - | -Cyclic Checksum -=============== -`(require 'crc)' +5.6 Cyclic Checksum | +=================== | -Cyclic Redundancy Checks using Galois field GF(2) polynomial arithmetic -are used for error detection in many data transmission and storage -applications. +`(require 'crc)' Cyclic Redundancy Checks using Galois field GF(2) | +polynomial arithmetic are used for error detection in many data | +transmission and storage applications. | The generator polynomials for various CRC protocols are availble from many sources. But the polynomial is just one of many parameters which @@ -5691,9 +6244,26 @@ existing systems: non-inverted) to the data stream. +The performance of a particular CRC polynomial over packets of given | +sizes varies widely. In terms of the probability of undetected errors, | +some uses of extant CRC polynomials are suboptimal by several orders of | +magnitude. | + | +If you are considering CRC for a new application, consult the following | +article to find the optimum CRC polynomial for your range of data | +lengths: | + | + * Philip Koopman and Tridib Chakravarty, | + "Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded | + Networks", | + The International Conference on Dependable Systems and Networks, | + DSN-2004. | + | +`http://www.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf' | + | There is even some controversy over the polynomials themselves. - - Constant: crc-32-polynomial + -- Constant: crc-32-polynomial | For CRC-32, http://www2.sis.pitt.edu/~jkabara/tele-2100/lect08.html gives x^32+x^26+x^23+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+1. @@ -5707,9 +6277,9 @@ There is even some controversy over the polynomials themselves. http://www.nobugconsulting.ro/crc.php give x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. - SLIB `crc-32-polynomial' uses the latter definition. | + SLIB `crc-32-polynomial' uses the latter definition. - - Constant: crc-ccitt-polynomial + -- Constant: crc-ccitt-polynomial | http://www.math.grin.edu/~rebelsky/Courses/CS364/2000S/Outlines/outline.12.html, http://duchon.umuc.edu/Web_Pages/duchon/99_f_cm435/ShiftRegister.htm, http://www.cs.ncl.ac.uk/people/harry.whitfield/home.formal/CRCs.html, @@ -5717,7 +6287,7 @@ There is even some controversy over the polynomials themselves. http://www.gpfn.sk.ca/~rhg/csc8550s02/crc.html give CRC-CCITT: x^16+x^12+x^5+1. - - Constant: crc-16-polynomial + -- Constant: crc-16-polynomial | http://www.math.grin.edu/~rebelsky/Courses/CS364/2000S/Outlines/outline.12.html, http://duchon.umuc.edu/Web_Pages/duchon/99_f_cm435/ShiftRegister.htm, http://www.cs.ncl.ac.uk/people/harry.whitfield/home.formal/CRCs.html, @@ -5725,7 +6295,7 @@ There is even some controversy over the polynomials themselves. http://www.usb.org/developers/data/crcdes.pdf give CRC-16: x^16+x^15+x^2+1. - - Constant: crc-12-polynomial + -- Constant: crc-12-polynomial | http://www.math.grin.edu/~rebelsky/Courses/CS364/2000S/Outlines/outline.12.html, http://www.cs.ncl.ac.uk/people/harry.whitfield/home.formal/CRCs.html, http://www.it.iitb.ac.in/it605/lectures/link/node4.html, and @@ -5742,10 +6312,11 @@ There is even some controversy over the polynomials themselves. x^12+x^11+x^3+x^2+x+1. These differ in bit 1 and calculations using them return different - values. With citations near evenly split, it is hard to know | - which is correct. | + values. With citations near evenly split, it is hard to know + which is correct. Thanks to Philip Koopman for breaking the tie | + in favor of the latter (#xC07). | - - Constant: crc-10-polynomial + -- Constant: crc-10-polynomial | http://www.math.grin.edu/~rebelsky/Courses/CS364/2000S/Outlines/outline.12.html gives CRC-10: x^10+x^9+x^5+x^4+1; but http://cell-relay.indiana.edu/cell-relay/publications/software/CRC/crc10.html, @@ -5756,29 +6327,29 @@ There is even some controversy over the polynomials themselves. http://www.nobugconsulting.ro/crc.php give CRC-10: x^10+x^9+x^5+x^4+x+1. - - Constant: crc-08-polynomial + -- Constant: crc-08-polynomial | http://www.math.grin.edu/~rebelsky/Courses/CS364/2000S/Outlines/outline.12.html, http://www.cs.ncl.ac.uk/people/harry.whitfield/home.formal/CRCs.html, http://www.it.iitb.ac.in/it605/lectures/link/node4.html, and http://www.nobugconsulting.ro/crc.php give CRC-8: x^8+x^2+x^1+1 - - Constant: atm-hec-polynomial + -- Constant: atm-hec-polynomial | http://cell-relay.indiana.edu/cell-relay/publications/software/CRC/32bitCRC.tutorial.html and http://www.gpfn.sk.ca/~rhg/csc8550s02/crc.html give ATM HEC: x^8+x^2+x+1. - - Constant: dowcrc-polynomial + -- Constant: dowcrc-polynomial | http://www.cs.ncl.ac.uk/people/harry.whitfield/home.formal/CRCs.html gives DOWCRC: x^8+x^5+x^4+1. - - Constant: usb-token-polynomial + -- Constant: usb-token-polynomial | http://www.usb.org/developers/data/crcdes.pdf and http://www.nobugconsulting.ro/crc.php give USB-token: x^5+x^2+1. Each of these polynomial constants is a string of `1's and `0's, the exponent of each power of X in descending order. - - Function: crc:make-table poly + -- Function: crc:make-table poly | POLY must be string of `1's and `0's beginning with `1' and having length greater than 8. `crc:make-table' returns a vector of 256 integers, such that: @@ -5796,28 +6367,28 @@ exponent of each power of X in descending order. `crc:make-table' returns #f. - - Function: cksum file + -- Function: cksum file | Computes the P1003.2/D11.2 (POSIX.2) 32-bit checksum of FILE. (require 'crc) (cksum (in-vicinity (library-vicinity) "ratize.scm")) => 157103930 - - Function: cksum port + -- Function: cksum port | Computes the checksum of the bytes read from PORT until the end-of-file. -`cksum-string', which returns the P1003.2/D11.2 (POSIX.2) 32-bit | -checksum of the bytes in STR, can be defined as follows: | +`cksum-string', which returns the P1003.2/D11.2 (POSIX.2) 32-bit +checksum of the bytes in STR, can be defined as follows: - (require 'string-port) | - (define (cksum-string str) (call-with-input-string str cksum)) | + (require 'string-port) + (define (cksum-string str) (call-with-input-string str cksum)) - - Function: crc16 file + -- Function: crc16 file | Computes the USB data-packet (16-bit) CRC of FILE. - - Function: crc16 port + -- Function: crc16 port | Computes the USB data-packet (16-bit) CRC of the bytes read from PORT until the end-of-file. @@ -5825,10 +6396,10 @@ checksum of the bytes in STR, can be defined as follows: | in http://www.usb.org/developers/data/crcdes.pdf. - - Function: crc5 file + -- Function: crc5 file | Computes the USB token (5-bit) CRC of FILE. - - Function: crc5 port + -- Function: crc5 port | Computes the USB token (5-bit) CRC of the bytes read from PORT until the end-of-file. @@ -5838,24 +6409,24 @@ checksum of the bytes in STR, can be defined as follows: | File: slib.info, Node: Graphing, Next: Solid Modeling, Prev: Cyclic Checksum, Up: Mathematical Packages - | -Graphing | -======== -* Menu: | - | -* Character Plotting:: | -* PostScript Graphing:: | - | +5.7 Graphing | +============ | + +* Menu: + +* Character Plotting:: +* PostScript Graphing:: + File: slib.info, Node: Character Plotting, Next: PostScript Graphing, Prev: Graphing, Up: Graphing - | -Character Plotting | ------------------- | - | -`(require 'charplot)' - - Variable: charplot:dimensions +5.7.1 Character Plotting | +------------------------ | + +`(require 'charplot)' + + -- Variable: charplot:dimensions | A list of the maximum height (number of lines) and maximum width (number of columns) for the graph, its scales, and labels. @@ -5863,7 +6434,7 @@ Character Plotting | `output-port-height' and `output-port-width' of `current-output-port'. - - Procedure: plot coords x-label y-label + -- Procedure: plot coords x-label y-label | COORDS is a list or vector of coordinates, lists of x and y coordinates. X-LABEL and Y-LABEL are strings with which to label the x and y axes. @@ -5871,12 +6442,12 @@ Character Plotting | Example: (require 'charplot) (set! charplot:dimensions '(20 55)) - + (define (make-points n) (if (zero? n) '() (cons (list (/ n 6) (sin (/ n 6))) (make-points (1- n))))) - + (plot (make-points 40) "x" "Sin(x)") -| Sin(x) _________________________________________ @@ -5900,8 +6471,8 @@ Character Plotting | |:_____._____:_____._____:_____._____:____| x 2 4 6 - - Procedure: plot func x1 x2 - - Procedure: plot func x1 x2 npts + -- Procedure: plot func x1 x2 | + -- Procedure: plot 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. @@ -5929,11 +6500,11 @@ Character Plotting | |_:_____._____:_____._____:_____._____:___| 0 2 4 6 - - Procedure: histograph data label + -- Procedure: histograph data label | Creates and displays a histogram of the numerical values contained in vector or list DATA - (require 'random-inexact) | + (require 'random-inexact) (histograph (do ((idx 99 (+ -1 idx)) (lst '() (cons (* .02 (random:normal)) lst))) ((negative? idx) lst)) @@ -5962,452 +6533,456 @@ Character Plotting | File: slib.info, Node: PostScript Graphing, Prev: Character Plotting, Up: Graphing - | -PostScript Graphing | -------------------- | - | -`(require 'eps-graph)' | - | -This is a graphing package creating encapsulated-PostScript files. Its | -motivations and design choice are described in | -<http://swissnet.ai.mit.edu/~jaffer/Docupage/grapheps> | - | -A dataset to be plotted is taken from a 2-dimensional array. | -Corresponding coordinates are in rows. Coordinates from any pair of | -columns can be plotted. | - | - - Function: create-postscript-graph filename.eps size elt1 ... | - FILENAME.EPS should be a string naming an output file to be | - created. SIZE should be an exact integer, a list of two exact | - integers, or #f. ELT1, ... are values returned by graphing | - primitives described here. | - | - `create-postscript-graph' creates an "Encapsulated-PostScript" | - file named FILENAME.EPS containing graphs as directed by the ELT1, | - ... arguments. | - | - The size of the graph is determined by the SIZE argument. If a | - list of two integers, they specify the width and height. If one | - integer, then that integer is the width and the height is 3/4 of | - the width. If #f, the graph will be 800 by 600. | - | -These graphing procedures should be called as arguments to | -`create-postscript-graph'. The order of these arguments is | -significant; PostScript graphics state is affected serially from the | -first ELT argument to the last. | - | - - Function: whole-page | - Pushes a rectangle for the whole encapsulated page onto the | - PostScript stack. This pushed rectangle is an implicit argument to | - `partition-page' or `setup-plot'. | - | -* Menu: | - | -* Column Ranges:: | -* Drawing the Graph:: | -* Graphics Context:: | -* Rectangles:: | -* Legending:: | -* Legacy Plotting:: | -* Example Graph:: | - | + +5.7.2 PostScript Graphing | +------------------------- | + +`(require 'eps-graph)' + +This is a graphing package creating encapsulated-PostScript files. Its +motivations and design choice are described in +`http://swiss.csail.mit.edu/~jaffer/Docupage/grapheps' | + +A dataset to be plotted is taken from a 2-dimensional array. +Corresponding coordinates are in rows. Coordinates from any pair of +columns can be plotted. + + -- Function: create-postscript-graph filename.eps size elt1 ... | + FILENAME.EPS should be a string naming an output file to be + created. SIZE should be an exact integer, a list of two exact + integers, or #f. ELT1, ... are values returned by graphing + primitives described here. + + `create-postscript-graph' creates an "Encapsulated-PostScript" + file named FILENAME.EPS containing graphs as directed by the ELT1, + ... arguments. + + The size of the graph is determined by the SIZE argument. If a + list of two integers, they specify the width and height. If one + integer, then that integer is the width and the height is 3/4 of + the width. If #f, the graph will be 800 by 600. + +These graphing procedures should be called as arguments to +`create-postscript-graph'. The order of these arguments is +significant; PostScript graphics state is affected serially from the +first ELT argument to the last. + + -- Function: whole-page | + Pushes a rectangle for the whole encapsulated page onto the + PostScript stack. This pushed rectangle is an implicit argument to + `partition-page' or `setup-plot'. + +* Menu: + +* Column Ranges:: +* Drawing the Graph:: +* Graphics Context:: +* Rectangles:: +* Legending:: +* Legacy Plotting:: +* Example Graph:: + File: slib.info, Node: Column Ranges, Next: Drawing the Graph, Prev: PostScript Graphing, Up: PostScript Graphing - | -Column Ranges | -............. | - | -A "range" is a list of two numbers, the minimum and the maximum. | -Ranges can be given explicity or computed in PostScript by | -`column-range'. | - | - - Function: column-range array k | - Returns the range of values in 2-dimensional ARRAY column K. | - | - - Function: pad-range range p | - Expands RANGE by P/100 on each end. | - | - - Function: snap-range range | - Expands RANGE to round number of ticks. | - | - - Function: combine-ranges range1 range2 ... | - Returns the minimal range covering all RANGE1, RANGE2, ... | - | - - Function: setup-plot x-range y-range pagerect | - - Function: setup-plot x-range y-range | - X-RANGE and Y-RANGE should each be a list of two numbers or the | - value returned by `pad-range', `snap-range', or `combine-range'. | - PAGERECT is the rectangle bounding the graph to be drawn; if | - missing, the rectangle from the top of the PostScript stack is | - popped and used. | - | - Based on the given ranges, `setup-plot' sets up scaling and | - margins for making a graph. The margins are sized proportional to | - the FONTHEIGHT value at the time of the call to setup-plot. | - `setup-plot' sets two variables: | - | - PLOTRECT | - The region where data points will be plotted. | - | - GRAPHRECT | - The PAGERECT argument to `setup-plot'. Includes plotrect, | - legends, etc. | - | + +5.7.2.1 Column Ranges | +..................... | + +A "range" is a list of two numbers, the minimum and the maximum. Ranges | +can be given explicity or computed in PostScript by `column-range'. | + + -- Function: column-range array k | + Returns the range of values in 2-dimensional ARRAY column K. + + -- Function: pad-range range p | + Expands RANGE by P/100 on each end. + + -- Function: snap-range range | + Expands RANGE to round number of ticks. + + -- Function: combine-ranges range1 range2 ... | + Returns the minimal range covering all RANGE1, RANGE2, ... + + -- Function: setup-plot x-range y-range pagerect | + -- Function: setup-plot x-range y-range | + X-RANGE and Y-RANGE should each be a list of two numbers or the + value returned by `pad-range', `snap-range', or `combine-range'. + PAGERECT is the rectangle bounding the graph to be drawn; if + missing, the rectangle from the top of the PostScript stack is + popped and used. + + Based on the given ranges, `setup-plot' sets up scaling and + margins for making a graph. The margins are sized proportional to + the FONTHEIGHT value at the time of the call to setup-plot. + `setup-plot' sets two variables: + + PLOTRECT + The region where data points will be plotted. + + GRAPHRECT + The PAGERECT argument to `setup-plot'. Includes plotrect, + legends, etc. + File: slib.info, Node: Drawing the Graph, Next: Graphics Context, Prev: Column Ranges, Up: PostScript Graphing - | -Drawing the Graph | -................. | - | - - Function: plot-column array x-column y-column proc3s | - Plots points with x coordinate in X-COLUMN of ARRAY and y | - coordinate Y-COLUMN of ARRAY. The symbol PROC3S specifies the | - type of glyph or drawing style for presenting these coordinates. | - | -The glyphs and drawing styles available are: | - | -`line' | - Draws line connecting points in order. | - | -`mountain' | - Fill area below line connecting points. | - | -`cloud' | - Fill area above line connecting points. | - | -`impulse' | - Draw line from x-axis to each point. | - | -`bargraph' | - Draw rectangle from x-axis to each point. | - | -`disc' | - Solid round dot. | - | -`point' | - Minimal point - invisible if linewidth is 0. | - | -`square' | - Square box. | - | -`diamond' | - Square box at 45.o | - | -`plus' | - Plus sign. | - | -`cross' | - X sign. | - | -`triup' | - Triangle pointing upward | - | -`tridown' | - Triangle pointing downward | - | -`pentagon' | - Five sided polygon | - | -`circle' | - Hollow circle | - | + +5.7.2.2 Drawing the Graph | +......................... | + + -- Function: plot-column array x-column y-column proc3s | + Plots points with x coordinate in X-COLUMN of ARRAY and y + coordinate Y-COLUMN of ARRAY. The symbol PROC3S specifies the + type of glyph or drawing style for presenting these coordinates. + +The glyphs and drawing styles available are: + +`line' + Draws line connecting points in order. + +`mountain' + Fill area below line connecting points. + +`cloud' + Fill area above line connecting points. + +`impulse' + Draw line from x-axis to each point. + +`bargraph' + Draw rectangle from x-axis to each point. + +`disc' + Solid round dot. + +`point' + Minimal point - invisible if linewidth is 0. + +`square' + Square box. + +`diamond' + Square box at 45.o + +`plus' + Plus sign. + +`cross' + X sign. + +`triup' + Triangle pointing upward + +`tridown' + Triangle pointing downward + +`pentagon' + Five sided polygon + +`circle' + Hollow circle + File: slib.info, Node: Graphics Context, Next: Rectangles, Prev: Drawing the Graph, Up: PostScript Graphing - | -Graphics Context | -................ | - | - - Function: in-graphic-context arg ... | - Saves the current graphics state, executes ARGS, then restores to | - saved graphics state. | - | - - Function: set-color color | - COLOR should be a string naming a Resene color, a saturate color, | - or a number between 0 and 100. | - | - `set-color' sets the PostScript color to the color of the given | - string, or a grey value between black (0) and white (100). | - | - - Function: set-font name fontheight | - NAME should be a (case-sensitive) string naming a PostScript font. | - FONTHEIGHT should be a positive real number. | - | - `set-font' Changes the current PostScript font to NAME with height | - equal to FONTHEIGHT. The default font is Helvetica (12pt). | - | -The base set of PostScript fonts is: | - | -Times Times-Italic Times-Bold Times-BoldItalic | -Helvetica Helvetica-Oblique Helvetica-Bold Helvetica-BoldOblique | -Courier Courier-Oblique Courier-Bold Courier-BoldOblique | -Symbol | - | -Line parameters do no affect fonts; they do effect glyphs. | - | - - Function: set-linewidth w | - The default linewidth is 1. Setting it to 0 makes the lines drawn | - as skinny as possible. Linewidth must be much smaller than | - glyphsize for readable glyphs. | - | - - Function: set-linedash j k | - Lines are drawn J-on K-off. | - | - - Function: set-linedash j | - Lines are drawn J-on J-off. | - | - - Function: set-linedash | - Turns off dashing. | - | - - Function: set-glyphsize w | - Sets the (PostScript) variable glyphsize to W. The default | - glyphsize is 6. | - | -The effects of `clip-to-rect' are also part of the graphic context. | - | + +5.7.2.3 Graphics Context | +........................ | + + -- Function: in-graphic-context arg ... | + Saves the current graphics state, executes ARGS, then restores to + saved graphics state. + + -- Function: set-color color | + COLOR should be a string naming a Resene color, a saturate color, + or a number between 0 and 100. + + `set-color' sets the PostScript color to the color of the given + string, or a grey value between black (0) and white (100). + + -- Function: set-font name fontheight | + NAME should be a (case-sensitive) string naming a PostScript font. + FONTHEIGHT should be a positive real number. + + `set-font' Changes the current PostScript font to NAME with height + equal to FONTHEIGHT. The default font is Helvetica (12pt). + +The base set of PostScript fonts is: + +Times Times-Italic Times-Bold Times-BoldItalic +Helvetica Helvetica-Oblique Helvetica-Bold Helvetica-BoldOblique +Courier Courier-Oblique Courier-Bold Courier-BoldOblique +Symbol + +Line parameters do no affect fonts; they do effect glyphs. + + -- Function: set-linewidth w | + The default linewidth is 1. Setting it to 0 makes the lines drawn + as skinny as possible. Linewidth must be much smaller than + glyphsize for readable glyphs. + + -- Function: set-linedash j k | + Lines are drawn J-on K-off. + + -- Function: set-linedash j | + Lines are drawn J-on J-off. + + -- Function: set-linedash | + Turns off dashing. + + -- Function: set-glyphsize w | + Sets the (PostScript) variable glyphsize to W. The default + glyphsize is 6. + +The effects of `clip-to-rect' are also part of the graphic context. + File: slib.info, Node: Rectangles, Next: Legending, Prev: Graphics Context, Up: PostScript Graphing - | -Rectangles | -.......... | - | -A "rectangle" is a list of 4 numbers; the first two elements are the x | -and y coordinates of lower left corner of the rectangle. The other two | -elements are the width and height of the rectangle. | - | - - Function: whole-page | - Pushes a rectangle for the whole encapsulated page onto the | - PostScript stack. This pushed rectangle is an implicit argument to | - `partition-page' or `setup-plot'. | - | - - Function: partition-page xparts yparts | - Pops the rectangle currently on top of the stack and pushes XPARTS | - * YPARTS sub-rectangles onto the stack in decreasing y and | - increasing x order. If you are drawing just one graph, then you | - don't need `partition-page'. | - | - - Variable: plotrect | - The rectangle where data points should be plotted. PLOTRECT is | - set by `setup-plot'. | - | - - Variable: graphrect | - The PAGERECT argument of the most recent call to `setup-plot'. | - Includes plotrect, legends, etc. | - | - - Function: fill-rect rect | - fills RECT with the current color. | - | - - Function: outline-rect rect | - Draws the perimiter of RECT in the current color. | - | - - Function: clip-to-rect rect | - Modifies the current graphics-state so that nothing will be drawn | - outside of the rectangle RECT. Use `in-graphic-context' to limit | - the extent of `clip-to-rect'. | - | + +5.7.2.4 Rectangles | +.................. | + +A "rectangle" is a list of 4 numbers; the first two elements are the x +and y coordinates of lower left corner of the rectangle. The other two +elements are the width and height of the rectangle. + + -- Function: whole-page | + Pushes a rectangle for the whole encapsulated page onto the + PostScript stack. This pushed rectangle is an implicit argument to + `partition-page' or `setup-plot'. + + -- Function: partition-page xparts yparts | + Pops the rectangle currently on top of the stack and pushes XPARTS + * YPARTS sub-rectangles onto the stack in decreasing y and + increasing x order. If you are drawing just one graph, then you + don't need `partition-page'. + + -- Variable: plotrect | + The rectangle where data points should be plotted. PLOTRECT is + set by `setup-plot'. + + -- Variable: graphrect | + The PAGERECT argument of the most recent call to `setup-plot'. + Includes plotrect, legends, etc. + + -- Function: fill-rect rect | + fills RECT with the current color. + + -- Function: outline-rect rect | + Draws the perimiter of RECT in the current color. + + -- Function: clip-to-rect rect | + Modifies the current graphics-state so that nothing will be drawn + outside of the rectangle RECT. Use `in-graphic-context' to limit + the extent of `clip-to-rect'. + File: slib.info, Node: Legending, Next: Legacy Plotting, Prev: Rectangles, Up: PostScript Graphing - | -Legending | -......... | - | - - Function: title-top title subtitle | - - Function: title-top title | - Puts a TITLE line and an optional SUBTITLE line above the | - `graphrect'. | - | - - Function: title-bottom title subtitle | - - Function: title-bottom title | - Puts a TITLE line and an optional SUBTITLE line below the | - `graphrect'. | - | - - Variable: topedge | - - Variable: bottomedge | - These edge coordinates of `graphrect' are suitable for passing as | - the first argument to `rule-horizontal'. | - | - - Variable: leftedge | - - Variable: rightedge | - These edge coordinates of `graphrect' are suitable for passing as | - the first argument to `rule-vertical'. | - | - - Function: rule-vertical x-coord text tick-width | - Draws a vertical ruler with X coordinate X-COORD and labeled with | - string TEXT. If TICK-WIDTH is positive, then the ticks are | - TICK-WIDTH long on the right side of X-COORD; and TEXT and numeric | - legends are on the left. If TICK-WIDTH is negative, then the | - ticks are -TICK-WIDTH long on the left side of X-COORD; and TEXT | - and numeric legends are on the right. | - | - - Function: rule-horizontal x-coord text tick-height | - Draws a horizontal ruler with X coordinate X-COORD and labeled with | - string TEXT. If TICK-HEIGHT is positive, then the ticks are | - TICK-HEIGHT long on the right side of X-COORD; and TEXT and | - numeric legends are on the left. If TICK-HEIGHT is negative, then | - the ticks are -TICK-HEIGHT long on the left side of X-COORD; and | - TEXT and numeric legends are on the right. | - | - - Function: y-axis | - Draws the y-axis. | - | - - Function: x-axis | - Draws the x-axis. | - | - - Function: grid-verticals | - Draws vertical lines through `graphrect' at each tick on the | - vertical ruler. | - | - - Function: grid-horizontals | - Draws horizontal lines through `graphrect' at each tick on the | - horizontal ruler. | - | + +5.7.2.5 Legending | +................. | + + -- Function: title-top title subtitle | + -- Function: title-top title | + Puts a TITLE line and an optional SUBTITLE line above the + `graphrect'. + + -- Function: title-bottom title subtitle | + -- Function: title-bottom title | + Puts a TITLE line and an optional SUBTITLE line below the + `graphrect'. + + -- Variable: topedge | + -- Variable: bottomedge | + These edge coordinates of `graphrect' are suitable for passing as + the first argument to `rule-horizontal'. + + -- Variable: leftedge | + -- Variable: rightedge | + These edge coordinates of `graphrect' are suitable for passing as + the first argument to `rule-vertical'. + + -- Function: set-margin-templates left right | + The margin-templates are strings whose displayed width is used to | + reserve space for the left and right side numerical legends. The | + default values are "-.0123456789". | + | + -- Function: rule-vertical x-coord text tick-width | + Draws a vertical ruler with X coordinate X-COORD and labeled with + string TEXT. If TICK-WIDTH is positive, then the ticks are + TICK-WIDTH long on the right side of X-COORD; and TEXT and numeric + legends are on the left. If TICK-WIDTH is negative, then the + ticks are -TICK-WIDTH long on the left side of X-COORD; and TEXT + and numeric legends are on the right. + + -- Function: rule-horizontal x-coord text tick-height | + Draws a horizontal ruler with X coordinate X-COORD and labeled with + string TEXT. If TICK-HEIGHT is positive, then the ticks are + TICK-HEIGHT long on the right side of X-COORD; and TEXT and + numeric legends are on the left. If TICK-HEIGHT is negative, then + the ticks are -TICK-HEIGHT long on the left side of X-COORD; and + TEXT and numeric legends are on the right. + + -- Function: y-axis | + Draws the y-axis. + + -- Function: x-axis | + Draws the x-axis. + + -- Function: grid-verticals | + Draws vertical lines through `graphrect' at each tick on the + vertical ruler. + + -- Function: grid-horizontals | + Draws horizontal lines through `graphrect' at each tick on the + horizontal ruler. + File: slib.info, Node: Legacy Plotting, Next: Example Graph, Prev: Legending, Up: PostScript Graphing - | -Legacy Plotting | -............... | - | - - Variable: graph:dimensions | - A list of the width and height of the graph to be plotted using | - `plot'. | - | - - Function: plot func x1 x2 npts | - - Function: plot func x1 x2 | - Creates and displays using `(system "gv tmp.eps")' an encapsulated | - PostScript graph of 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. | - | - - Function: plot coords x-label y-label | - COORDS is a list or vector of coordinates, lists of x and y | - coordinates. X-LABEL and Y-LABEL are strings with which to label | - the x and y axes. | - | + +5.7.2.6 Legacy Plotting | +....................... | + + -- Variable: graph:dimensions | + A list of the width and height of the graph to be plotted using + `plot'. + + -- Function: plot func x1 x2 npts | + -- Function: plot func x1 x2 | + Creates and displays using `(system "gv tmp.eps")' an encapsulated + PostScript graph of 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. + + -- Function: plot coords x-label y-label | + COORDS is a list or vector of coordinates, lists of x and y + coordinates. X-LABEL and Y-LABEL are strings with which to label + the x and y axes. + File: slib.info, Node: Example Graph, Prev: Legacy Plotting, Up: PostScript Graphing - | -Example Graph | -............. | - | -The file `am1.5.html', a table of solar irradiance, is fetched with | -`wget' if it isn't already in the working directory. The file is read | -and stored into an array, IRRADIANCE. | - | - `create-postscript-graph' is then called to create an | -encapsulated-PostScript file, `solarad.eps'. The size of the page is | -set to 600 by 300. `whole-page' is called and leaves the rectangle on | -the PostScript stack. `setup-plot' is called with a literal range for | -x and computes the range for column 1. | - | - Two calls to `top-title' are made so a different font can be used for | -the lower half. `in-graphic-context' is used to limit the scope of the | -font change. The graphing area is outlined and a rule drawn on the | -left side. | - | - Because the X range was intentionally reduced, `in-graphic-context' | -is called and `clip-to-rect' limits drawing to the plotting area. A | -black line is drawn from data column 1. That line is then overlayed | -with a mountain plot of the same column colored "Bright Sun". | - | - After returning from the `in-graphic-context', the bottom ruler is | -drawn. Had it been drawn earlier, all its ticks would have been | -painted over by the mountain plot. | - | - The color is then changed to `seagreen' and the same graphrect is | -setup again, this time with a different Y scale, 0 to 1000. The | -graphic context is again clipped to PLOTRECT, linedash is set, and | -column 2 is plotted as a dashed line. Finally the rightedge is ruled. | -Having the line and its scale both in green helps disambiguate the | -scales. | - | - (require 'eps-graph) | - (require 'line-i/o) | - (require 'string-port) | - | - (define irradiance | - (let ((url "http://www.pv.unsw.edu.au/am1.5.html") | - (file "am1.5.html")) | - (define (read->list line) | - (define elts '()) | - (call-with-input-string line | - (lambda (iprt) (do ((elt (read iprt) (read iprt))) | - ((eof-object? elt) elts) | - (set! elts (cons elt elts)))))) | - (if (not (file-exists? file)) | - (system (string-append "wget -c -O" file " " url))) | - (call-with-input-file file | - (lambda (iprt) | - (define lines '()) | - (do ((line (read-line iprt) (read-line iprt))) | - ((eof-object? line) | - (let ((nra (create-array (Ar64) | - (length lines) | - (length (car lines))))) | - (do ((lns lines (cdr lns)) | - (idx (+ -1 (length lines)) (+ -1 idx))) | - ((null? lns) nra) | - (do ((kdx (+ -1 (length (car lines))) (+ -1 kdx)) | - (lst (car lns) (cdr lst))) | - ((null? lst)) | - (array-set! nra (car lst) idx kdx))))) | - (if (and (positive? (string-length line)) | - (char-numeric? (string-ref line 0))) | - (set! lines (cons (read->list line) lines)))))))) | - | - (let ((xrange '(.25 2.5))) | - (create-postscript-graph | - "solarad.eps" '(600 300) | - (whole-page) | - (setup-plot xrange (column-range irradiance 1)) | - (title-top | - "Solar Irradiance http://www.pv.unsw.edu.au/am1.5.html") | - (in-graphic-context | - (set-font "Helvetica-Oblique" 12) | - (title-top | - "" | + +5.7.2.7 Example Graph | +..................... | + +The file `am1.5.html', a table of solar irradiance, is fetched with +`wget' if it isn't already in the working directory. The file is read +and stored into an array, IRRADIANCE. + + `create-postscript-graph' is then called to create an +encapsulated-PostScript file, `solarad.eps'. The size of the page is +set to 600 by 300. `whole-page' is called and leaves the rectangle on +the PostScript stack. `setup-plot' is called with a literal range for +x and computes the range for column 1. + + Two calls to `top-title' are made so a different font can be used for +the lower half. `in-graphic-context' is used to limit the scope of the +font change. The graphing area is outlined and a rule drawn on the +left side. + + Because the X range was intentionally reduced, `in-graphic-context' +is called and `clip-to-rect' limits drawing to the plotting area. A +black line is drawn from data column 1. That line is then overlayed +with a mountain plot of the same column colored "Bright Sun". + + After returning from the `in-graphic-context', the bottom ruler is +drawn. Had it been drawn earlier, all its ticks would have been +painted over by the mountain plot. + + The color is then changed to `seagreen' and the same graphrect is +setup again, this time with a different Y scale, 0 to 1000. The +graphic context is again clipped to PLOTRECT, linedash is set, and +column 2 is plotted as a dashed line. Finally the rightedge is ruled. +Having the line and its scale both in green helps disambiguate the +scales. + + (require 'eps-graph) + (require 'line-i/o) + (require 'string-port) + + (define irradiance + (let ((url "http://www.pv.unsw.edu.au/am1.5.html") + (file "am1.5.html")) + (define (read->list line) + (define elts '()) + (call-with-input-string line + (lambda (iprt) (do ((elt (read iprt) (read iprt))) + ((eof-object? elt) elts) + (set! elts (cons elt elts)))))) + (if (not (file-exists? file)) + (system (string-append "wget -c -O" file " " url))) + (call-with-input-file file + (lambda (iprt) + (define lines '()) + (do ((line (read-line iprt) (read-line iprt))) + ((eof-object? line) + (let ((nra (make-array (A:floR64b) | + (length lines) + (length (car lines))))) + (do ((lns lines (cdr lns)) + (idx (+ -1 (length lines)) (+ -1 idx))) + ((null? lns) nra) + (do ((kdx (+ -1 (length (car lines))) (+ -1 kdx)) + (lst (car lns) (cdr lst))) + ((null? lst)) + (array-set! nra (car lst) idx kdx))))) + (if (and (positive? (string-length line)) + (char-numeric? (string-ref line 0))) + (set! lines (cons (read->list line) lines)))))))) + + (let ((xrange '(.25 2.5))) + (create-postscript-graph + "solarad.eps" '(600 300) + (whole-page) + (setup-plot xrange (column-range irradiance 1)) + (title-top + "Solar Irradiance http://www.pv.unsw.edu.au/am1.5.html") + (in-graphic-context + (set-font "Helvetica-Oblique" 12) + (title-top + "" "Key Centre for Photovoltaic Engineering UNSW - Air Mass 1.5 Global Spectrum")) - (outline-rect plotrect) | - (rule-vertical leftedge "W/(m^2.um)" 10) | - (in-graphic-context (clip-to-rect plotrect) | - (plot-column irradiance 0 1 'line) | - (set-color "Bright Sun") | - (plot-column irradiance 0 1 'mountain) | - ) | - (rule-horizontal bottomedge "Wavelength in .um" 5) | - (set-color 'seagreen) | - | - (setup-plot xrange '(0 1000) graphrect) | - (in-graphic-context (clip-to-rect plotrect) | - (set-linedash 5 2) | - (plot-column irradiance 0 2 'line)) | - (rule-vertical rightedge "Integrated .W/(m^2)" -10) | - )) | - | - (system "gv solarad.eps") | - | + (outline-rect plotrect) + (rule-vertical leftedge "W/(m^2.um)" 10) + (in-graphic-context (clip-to-rect plotrect) + (plot-column irradiance 0 1 'line) + (set-color "Bright Sun") + (plot-column irradiance 0 1 'mountain) + ) + (rule-horizontal bottomedge "Wavelength in .um" 5) + (set-color 'seagreen) + + (setup-plot xrange '(0 1000) graphrect) + (in-graphic-context (clip-to-rect plotrect) + (set-linedash 5 2) + (plot-column irradiance 0 2 'line)) + (rule-vertical rightedge "Integrated .W/(m^2)" -10) + )) + + (system "gv solarad.eps") + File: slib.info, Node: Solid Modeling, Next: Color, Prev: Graphing, Up: Mathematical Packages - | -Solid Modeling -============== -`(require 'solid)' +5.8 Solid Modeling | +================== | -`http://swissnet.ai.mit.edu/~jaffer/Solid/#Example' gives an example +`(require 'solid)' + +`http://swiss.csail.mit.edu/~jaffer/Solid/#Example' gives an example | use of this package. - - Function: vrml node ... + -- Function: vrml node ... | Returns the VRML97 string (including header) of the concatenation of strings NODES, .... - - Function: vrml-append node1 node2 ... + -- Function: vrml-append node1 node2 ... | Returns the concatenation with interdigitated newlines of strings NODE1, NODE2, .... - - Function: vrml-to-file file node ... + -- Function: vrml-to-file file node ... | Writes to file named FILE the VRML97 string (including header) of the concatenation of strings NODES, .... - - Function: world:info title info ... + -- Function: world:info title info ... | Returns a VRML97 string setting the title of the file in which it appears to TITLE. Additional strings INFO, ... are comments. @@ -6416,11 +6991,11 @@ appear in the resulting VRML code. This string turns off the headlight at the viewpoint: " NavigationInfo {headlight FALSE}" - - Function: scene:panorama front right back left top bottom + -- Function: scene:panorama front right back left top bottom | Specifies the distant images on the inside faces of the cube enclosing the virtual world. - - Function: scene:sphere colors angles + -- Function: scene:sphere colors angles | COLORS is a list of color objects. Each may be of type *Note color: Color Data-Type, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. @@ -6431,16 +7006,16 @@ at the viewpoint: are taken from the colors paired with the angles nearest them. `scene:sphere' fills horizontal bands with interpolated colors on - the backgroud sphere encasing the world. + the background sphere encasing the world. | - - Function: scene:sky-and-dirt - Returns a blue and brown backgroud sphere encasing the world. + -- Function: scene:sky-and-dirt | + Returns a blue and brown background sphere encasing the world. | - - Function: scene:sky-and-grass - Returns a blue and green backgroud sphere encasing the world. + -- Function: scene:sky-and-grass | + Returns a blue and green background sphere encasing the world. | - - Function: scene:sun latitude julian-day hour turbidity strength - - Function: scene:sun latitude julian-day hour turbidity + -- Function: scene:sun latitude julian-day hour turbidity strength | + -- Function: scene:sun latitude julian-day hour turbidity | LATITUDE is the virtual place's latitude in degrees. JULIAN-DAY is an integer from 0 to 366, the day of the year. HOUR is a real number from 0 to 24 for the time of day; 12 is noon. TURBIDITY is @@ -6450,8 +7025,8 @@ at the viewpoint: would be at HOUR on JULIAN-DAY at LATITUDE. If STRENGTH is positive, included is a light source of STRENGTH (default 1). - - Function: scene:overcast latitude julian-day hour turbidity strength - - Function: scene:overcast latitude julian-day hour turbidity + -- Function: scene:overcast latitude julian-day hour turbidity strength | + -- Function: scene:overcast latitude julian-day hour turbidity | LATITUDE is the virtual place's latitude in degrees. JULIAN-DAY is an integer from 0 to 366, the day of the year. HOUR is a real number from 0 to 24 for the time of day; 12 is noon. TURBIDITY is @@ -6464,14 +7039,14 @@ at the viewpoint: Viewpoints are objects in the virtual world, and can be transformed individually or with solid objects. - - Function: scene:viewpoint name distance compass pitch - - Function: scene:viewpoint name distance compass + -- Function: scene:viewpoint name distance compass pitch | + -- Function: scene:viewpoint name distance compass | Returns a viewpoint named NAME facing the origin and placed DISTANCE from it. COMPASS is a number from 0 to 360 giving the compass heading. PITCH is a number from -90 to 90, defaulting to 0, specifying the angle from the horizontal. - - Function: scene:viewpoints proximity + -- Function: scene:viewpoints proximity | Returns 6 viewpoints, one at the center of each face of a cube with sides 2 * PROXIMITY, centered on the origin. @@ -6493,8 +7068,8 @@ It is sometimes useful for light sources to be brighter than `1'. When INTENSITY arguments are greater than 1, these functions gang multiple sources to reach the desired strength. - - Function: light:ambient color intensity - - Function: light:ambient color + -- Function: light:ambient color intensity | + -- Function: light:ambient color | Ambient light shines on all surfaces with which it is grouped. COLOR is a an object of type *Note color: Color Data-Type, a @@ -6505,9 +7080,9 @@ sources to reach the desired strength. `light:ambient' returns a light source or sources of COLOR with total strength of INTENSITY (or 1 if omitted). - - Function: light:directional color direction intensity - - Function: light:directional color direction - - Function: light:directional color + -- Function: light:directional color direction intensity | + -- Function: light:directional color direction | + -- Function: light:directional color | Directional light shines parallel rays with uniform intensity on all objects with which it is grouped. @@ -6527,10 +7102,10 @@ sources to reach the desired strength. `light:directional' returns a light source or sources of COLOR with total strength of INTENSITY, shining from DIRECTION. - - Function: light:beam attenuation radius aperture peak - - Function: light:beam attenuation radius aperture - - Function: light:beam attenuation radius - - Function: light:beam attenuation + -- Function: light:beam attenuation radius aperture peak | + -- Function: light:beam attenuation radius aperture | + -- Function: light:beam attenuation radius | + -- Function: light:beam attenuation | ATTENUATION is a list or vector of three nonnegative real numbers specifying the reduction of intensity, the reduction of intensity with distance, and the reduction of intensity as the square of @@ -6541,10 +7116,10 @@ sources to reach the desired strength. the light's axis through which it sheds some light. PEAK is a real number between 0 and 90, the angle of greatest illumination. - - Function: light:point location color intensity beam - - Function: light:point location color intensity - - Function: light:point location color - - Function: light:point location + -- Function: light:point location color intensity beam | + -- Function: light:point location color intensity | + -- Function: light:point location color | + -- Function: light:point location | Point light radiates from LOCATION, intensity decreasing with distance, towards all objects with which it is grouped. @@ -6559,11 +7134,11 @@ sources to reach the desired strength. that the pointlight itself is not visible. To make it so, place an object with emissive appearance at LOCATION. - - Function: light:spot location direction color intensity beam - - Function: light:spot location direction color intensity - - Function: light:spot location direction color - - Function: light:spot location direction - - Function: light:spot location + -- Function: light:spot location direction color intensity beam | + -- Function: light:spot location direction color intensity | + -- Function: light:spot location direction color | + -- Function: light:spot location direction | + -- Function: light:spot location | Spot light radiates from LOCATION towards DIRECTION, intensity decreasing with distance, illuminating objects with which it is grouped. @@ -6589,8 +7164,8 @@ sources to reach the desired strength. Object Primitives ----------------- - - Function: solid:box geometry appearance - - Function: solid:box geometry + -- Function: solid:box geometry appearance | + -- Function: solid:box geometry | GEOMETRY must be a number or a list or vector of three numbers. If GEOMETRY is a number, the `solid:box' returns a cube with sides of length GEOMETRY centered on the origin. Otherwise, `solid:box' @@ -6598,40 +7173,41 @@ Object Primitives origin. APPEARANCE determines the surface properties of the returned object. - - Function: solid:cylinder radius height appearance - - Function: solid:cylinder radius height - Returns a right cylinder with dimensions RADIUS and `(abs HEIGHT)' - centered on the origin. If HEIGHT is positive, then the cylinder - ends will be capped. APPEARANCE determines the surface properties - of the returned object. + -- Function: solid:cylinder radius height appearance | + -- Function: solid:cylinder radius height | + Returns a right cylinder with dimensions `(abs RADIUS)' and `(abs | + HEIGHT)' centered on the origin. If HEIGHT is positive, then the | + cylinder ends will be capped. If RADIUS is negative, then only | + the ends will appear. APPEARANCE determines the surface | + properties of the returned object. | - - Function: solid:disk radius thickness appearance - - Function: solid:disk radius thickness + -- Function: solid:disk radius thickness appearance | + -- Function: solid:disk radius thickness | THICKNESS must be a positive real number. `solid:disk' returns a circular disk with dimensions RADIUS and THICKNESS centered on the origin. APPEARANCE determines the surface properties of the returned object. - - Function: solid:cone radius height appearance - - Function: solid:cone radius height + -- Function: solid:cone radius height appearance | + -- Function: solid:cone radius height | Returns an isosceles cone with dimensions RADIUS and HEIGHT centered on the origin. APPEARANCE determines the surface properties of the returned object. - - Function: solid:pyramid side height appearance - - Function: solid:pyramid side height + -- Function: solid:pyramid side height appearance | + -- Function: solid:pyramid side height | Returns an isosceles pyramid with dimensions SIDE and HEIGHT centered on the origin. APPEARANCE determines the surface properties of the returned object. - - Function: solid:sphere radius appearance - - Function: solid:sphere radius + -- Function: solid:sphere radius appearance | + -- Function: solid:sphere radius | Returns a sphere of radius RADIUS centered on the origin. APPEARANCE determines the surface properties of the returned object. - - Function: solid:ellipsoid geometry appearance - - Function: solid:ellipsoid geometry + -- Function: solid:ellipsoid geometry appearance | + -- Function: solid:ellipsoid geometry | GEOMETRY must be a number or a list or vector of three numbers. If GEOMETRY is a number, the `solid:ellipsoid' returns a sphere of diameter GEOMETRY centered on the origin. Otherwise, @@ -6639,9 +7215,23 @@ Object Primitives centered on the origin. APPEARANCE determines the surface properties of the returned object. - - Function: solid:basrelief width height depth colorray appearance - - Function: solid:basrelief width height depth appearance - - Function: solid:basrelief width height depth + -- Function: solid:polyline coordinates appearance | + -- Function: solid:polyline coordinates | + COORDINATES must be a list or vector of coordinate lists or vectors | + specifying the x, y, and z coordinates of points. | + `solid:polyline' returns lines connecting successive pairs of | + points. If called with one argument, then the polyline will be | + white. If APPEARANCE is given, then the polyline will have its | + emissive color only; being black if APPEARANCE does not have an | + emissive color. | + | + The following code will return a red line between points at `(1 2 | + 3)' and `(4 5 6)': | + (solid:polyline '((1 2 3) (4 5 6)) (solid:color #f 0 #f 0 '(1 0 0))) + | + -- Function: solid:basrelief width height depth colorray appearance | + -- Function: solid:basrelief width height depth appearance | + -- Function: solid:basrelief width height depth | One of WIDTH, HEIGHT, or DEPTH must be a 2-dimensional array; the others must be real numbers giving the length of the basrelief in those dimensions. The rest of this description assumes that @@ -6662,36 +7252,52 @@ Object Primitives COLORRAY paints the corresponding face of HEIGHT. Other dimensions for COLORRAY are in error. + -- Function: solid:text fontstyle str len appearance | + -- Function: solid:text fontstyle str len | + FONTSTYLE must be a value returned by `solid:font'. | + | + STR must be a string or list of strings. | + | + LEN must be #f, a nonnegative integer, or list of nonnegative | + integers. | + | + APPEARANCE, if given, determines the surface properties of the | + returned object. | + | + `solid:text' returns a two-sided, flat text object positioned in | + the Z=0 plane of the local coordinate system | + | Surface Attributes ------------------ - - Function: solid:color diffuseColor ambientIntensity specularColor + -- Function: solid:color diffuseColor ambientIntensity specularColor | shininess emissiveColor transparency - - Function: solid:color diffuseColor ambientIntensity specularColor + -- Function: solid:color diffuseColor ambientIntensity specularColor | shininess emissiveColor - - Function: solid:color diffuseColor ambientIntensity specularColor + -- Function: solid:color diffuseColor ambientIntensity specularColor | shininess - - Function: solid:color diffuseColor ambientIntensity specularColor - - Function: solid:color diffuseColor ambientIntensity - - Function: solid:color diffuseColor - Returns an "appearance", the optical properties of the objects - with which it is associated. AMBIENTINTENSITY, SHININESS, and + -- Function: solid:color diffuseColor ambientIntensity specularColor | + -- Function: solid:color diffuseColor ambientIntensity | + -- Function: solid:color diffuseColor | + Returns an "appearance", the optical properties of the objects with | + which it is associated. AMBIENTINTENSITY, SHININESS, and | TRANSPARENCY must be numbers between 0 and 1. DIFFUSECOLOR, SPECULARCOLOR, and EMISSIVECOLOR are objects of type *Note color: Color Data-Type, 24-bit sRGB integers or lists of 3 numbers between 0.0 and 1.0. If a color argument is omitted or #f, then the default color will be used. - - Function: solid:texture image color scale rotation center translation - - Function: solid:texture image color scale rotation center - - Function: solid:texture image color scale rotation - - Function: solid:texture image color scale - - Function: solid:texture image color - - Function: solid:texture image - Returns an "appearance", the optical properties of the objects - with which it is associated. IMAGE is a string naming a JPEG or - PNG image resource. COLOR is #f, a color, or the string returned - by `solid:color'. The rest of the optional arguments specify + -- Function: solid:texture image color scale rotation center | + translation | + -- Function: solid:texture image color scale rotation center | + -- Function: solid:texture image color scale rotation | + -- Function: solid:texture image color scale | + -- Function: solid:texture image color | + -- Function: solid:texture image | + Returns an "appearance", the optical properties of the objects with | + which it is associated. IMAGE is a string naming a JPEG or PNG | + image resource. COLOR is #f, a color, or the string returned by | + `solid:color'. The rest of the optional arguments specify | 2-dimensional transforms applying to the IMAGE. SCALE must be #f, a number, or list or vector of 2 numbers @@ -6702,42 +7308,75 @@ Surface Attributes list or vector of 2 numbers specifying the translation to apply to IMAGE. + -- Function: solid:font family style justify size spacing language | + direction | + Returns a fontstyle object suitable for passing as an argument to | + `solid:text'. Any of the arguments may be #f, in which case its | + default value, which is first in each list of allowed values, is | + used. | + | + FAMILY is a case-sensitive string naming a font; `SERIF', `SANS', | + and `TYPEWRITER' are supported at the minimum. | + | + STYLE is a case-sensitive string `PLAIN', `BOLD', `ITALIC', or | + `BOLDITALIC'. | + | + JUSTIFY is a case-sensitive string `FIRST', `BEGIN', `MIDDLE', or | + `END'; or a list of one or two case-sensitive strings (same | + choices). The mechanics of JUSTIFY get complicated; it is | + explained by tables 6.2 to 6.7 of | + `http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/nodesRef.html#Table6.2' + | + SIZE is the extent, in the non-advancing direction, of the text. | + SIZE defaults to 1. | + | + SPACING is the ratio of the line (or column) offset to SIZE. | + SPACING defaults to 1. | + | + LANGUAGE is the RFC-1766 language name. | + | + DIRECTION is a list of two numbers: `(X Y)'. If | + `(> (abs X) (abs Y))', then the text will be arrayed horizontally; | + otherwise vertically. The direction in which characters are | + arrayed is determined by the sign of the major axis: positive X | + being left-to-right; positive Y being top-to-bottom. | + | Aggregating Objects ------------------- - - Function: solid:center-row-of number solid spacing + -- Function: solid:center-row-of number solid spacing | Returns a row of NUMBER SOLID objects spaced evenly SPACING apart. - - Function: solid:center-array-of number-a number-b solid spacing-a + -- Function: solid:center-array-of number-a number-b solid spacing-a | spacing-b Returns NUMBER-B rows, SPACING-B apart, of NUMBER-A SOLID objects SPACING-A apart. - - Function: solid:center-pile-of number-a number-b number-c solid + -- Function: solid:center-pile-of number-a number-b number-c solid | spacing-a spacing-b spacing-c Returns NUMBER-C planes, SPACING-C apart, of NUMBER-B rows, SPACING-B apart, of NUMBER-A SOLID objects SPACING-A apart. - - Function: solid:arrow center + -- Function: solid:arrow center | CENTER must be a list or vector of three numbers. Returns an upward pointing metallic arrow centered at CENTER. - - Function: solid:arrow + -- Function: solid:arrow | Returns an upward pointing metallic arrow centered at the origin. Spatial Transformations ----------------------- - - Function: solid:translation center solid ... + -- Function: solid:translation center solid ... | CENTER must be a list or vector of three numbers. `solid:translation' Returns an aggregate of SOLIDS, ... with their origin moved to CENTER. - - Function: solid:scale scale solid ... + -- Function: solid:scale scale solid ... | SCALE must be a number or a list or vector of three numbers. `solid:scale' Returns an aggregate of SOLIDS, ... scaled per SCALE. - - Function: solid:rotation axis angle solid ... + -- Function: solid:rotation axis angle solid ... | AXIS must be a list or vector of three numbers. `solid:rotation' Returns an aggregate of SOLIDS, ... rotated ANGLE degrees around the axis AXIS. @@ -6745,10 +7384,10 @@ Spatial Transformations File: slib.info, Node: Color, Next: Root Finding, Prev: Solid Modeling, Up: Mathematical Packages -Color -===== +5.9 Color | +========= | -`http://swissnet.ai.mit.edu/~jaffer/Color' +`http://swiss.csail.mit.edu/~jaffer/Color' | The goals of this package are to provide methods to specify, compute, and transform colors in a core set of additive color spaces. The color @@ -6768,15 +7407,15 @@ encountered in practice and the literature. File: slib.info, Node: Color Data-Type, Next: Color Spaces, Prev: Color, Up: Color -Color Data-Type ---------------- +5.9.1 Color Data-Type | +--------------------- | `(require 'color)' - - Function: color? obj + -- Function: color? obj | Returns #t if OBJ is a color. - - Function: color? obj typ + -- Function: color? obj typ | Returns #t if OBJ is a color of color-space TYP. The symbol TYP must be one of: @@ -6794,27 +7433,37 @@ Color Data-Type * L*C*h - - Function: make-color space arg ... + -- Function: make-color space arg ... | Returns a color of type SPACE. - - Function: color-space color + * For SPACE arguments `CIEXYZ', `RGB709', and `sRGB', the sole | + ARG is a list of three numbers. | + | + * For SPACE arguments `L*a*b*', `L*u*v*', and `L*C*h', ARG is a | + list of three numbers optionally followed by a whitepoint. | + | + * For `xRGB', ARG is an integer. | + | + * For `e-sRGB', the arguments are as for `e-sRGB->color'. | + | + -- Function: color-space color | Returns the symbol for the color-space in which COLOR is embedded. - - Function: color-precision color + -- Function: color-precision color | For colors in digital color-spaces, `color-precision' returns the number of bits used for each of the R, G, and B channels of the encoding. Otherwise, `color-precision' returns #f - - Function: color-white-point color + -- Function: color-white-point color | Returns the white-point of COLOR in all color-spaces except CIEXYZ. - - Function: convert-color color space white-point - - Function: convert-color color space - - Function: convert-color color e-sRGB precision + -- Function: convert-color color space white-point | + -- Function: convert-color color space | + -- Function: convert-color color e-sRGB precision | Converts COLOR into SPACE at optional WHITE-POINT. -External Representation -....................... +5.9.1.1 External Representation | +............................... | Each color encoding has an external, case-insensitive representation. To ensure portability, the white-point for all color strings is D65. @@ -6849,32 +7498,32 @@ sRGB #x<RRGGBB> Where RRGGBB is a non-negative six-digit hexadecimal number. - - Function: color->string color + -- Function: color->string color | Returns a string representation of COLOR. - - Function: string->color string + -- Function: string->color string | Returns the color represented by STRING. If STRING is not a syntactically valid notation for a color, then `string->color' returns #f. -White -..... +5.9.1.2 White | +............. | We experience color relative to the illumination around us. CIEXYZ coordinates, although subject to uniform scaling, are objective. Thus other color spaces are specified relative to a "white point" in CIEXYZ -coordinates. +coordinates. The white point for digital color spaces is set to D65. For the other spaces a WHITE-POINT argument can be specified. The default if none is specified is the white-point with which the color was created or last converted; and D65 if none has been specified. - - Constant: D65 + -- Constant: D65 | Is the color of 6500.K (blackbody) illumination. D65 is close to the average color of daylight. - - Constant: D50 + -- Constant: D50 | Is the color of 5000.K (blackbody) illumination. D50 is the color of indoor lighting by incandescent bulbs, whose filaments have temperatures around 5000.K. @@ -6892,58 +7541,58 @@ device-dependent RGBi and RGB spaces of Xlib. File: slib.info, Node: Color Spaces, Next: Spectra, Prev: Color Data-Type, Up: Color -Color Spaces ------------- +5.9.2 Color Spaces | +------------------ | Measurement-based Color Spaces .............................. The "tristimulus" color spaces are those whose component values are proportional measurements of light intensity. The CIEXYZ(1931) system -provides 3 sets of spectra to convolve with a spectrum of interest. -The result of those convolutions is coordinates in CIEXYZ space. All +provides 3 sets of spectra to dot-product with a spectrum of interest. | +The result of those dot-products is coordinates in CIEXYZ space. All | tristimuls color spaces are related to CIEXYZ by linear transforms, namely matrix multiplication. Of the color spaces listed here, CIEXYZ and RGB709 are tristimulus spaces. - - Color Space: CIEXYZ + -- Color Space: CIEXYZ | The CIEXYZ color space covers the full "gamut". It is the basis for color-space conversions. - CIEXYZ is a list of three inexact numbers between 0 and 1.1. '(0. - 0. 0.) is black; '(1. 1. 1.) is white. + CIEXYZ is a list of three inexact numbers between 0.0 and 1.1. | + '(0. 0. 0.) is black; '(1. 1. 1.) is white. | - - Function: ciexyz->color xyz + -- Function: ciexyz->color xyz | XYZ must be a list of 3 numbers. If XYZ is valid CIEXYZ coordinates, then `ciexyz->color' returns the color specified by XYZ; otherwise returns #f. - - Function: color:ciexyz x y z + -- Function: color:ciexyz x y z | Returns the CIEXYZ color composed of X, Y, Z. If the coordinates do not encode a valid CIEXYZ color, then an error is signaled. - - Function: color->ciexyz color + -- Function: color->ciexyz color | Returns the list of 3 numbers encoding COLOR in CIEXYZ. - - Color Space: RGB709 + -- Color Space: RGB709 | BT.709-4 (03/00) `Parameter values for the HDTV standards for production and international programme exchange' specifies parameter values for chromaticity, sampling, signal format, frame rates, etc., of high definition television signals. An RGB709 color is represented by a list of three inexact numbers - between 0 and 1. '(0. 0. 0.) is black '(1. 1. 1.) is white. + between 0.0 and 1.0. '(0. 0. 0.) is black '(1. 1. 1.) is white. | - - Function: rgb709->color rgb + -- Function: rgb709->color rgb | RGB must be a list of 3 numbers. If RGB is valid RGB709 coordinates, then `rgb709->color' returns the color specified by RGB; otherwise returns #f. - - Function: color:rgb709 r g b + -- Function: color:rgb709 r g b | Returns the RGB709 color composed of R, G, B. If the coordinates do not encode a valid RGB709 color, then an error is signaled. - - Function: color->rgb709 color + -- Function: color->rgb709 color | Returns the list of 3 numbers encoding COLOR in RGB709. Perceptual Uniformity @@ -6956,58 +7605,58 @@ range of distances (6:1) in the L*a*b* and L*u*v* spaces than in tristimulus spaces (80:1). For this reason, color distances are computed in L*a*b* (or L*C*h). - - Color Space: L*a*b* + -- Color Space: L*a*b* | Is a CIE color space which better matches the human visual system's perception of color. It is a list of three numbers: - * 0 <= L* <= 100 (CIE "Lightness") + * 0 <= L* <= 100 (CIE "Lightness") * -500 <= a* <= 500 * -200 <= b* <= 200 - - Function: l*a*b*->color L*a*b* white-point + -- Function: l*a*b*->color L*a*b* white-point | L*A*B* must be a list of 3 numbers. If L*A*B* is valid L*a*b* coordinates, then `l*a*b*->color' returns the color specified by L*A*B*; otherwise returns #f. - - Function: color:l*a*b* L* a* b* white-point + -- Function: color:l*a*b* L* a* b* white-point | Returns the L*a*b* color composed of L*, A*, B* with WHITE-POINT. - - Function: color:l*a*b* L* a* b* + -- Function: color:l*a*b* L* a* b* | Returns the L*a*b* color composed of L*, A*, B*. If the coordinates do not encode a valid L*a*b* color, then an error is signaled. - - Function: color->l*a*b* color white-point + -- Function: color->l*a*b* color white-point | Returns the list of 3 numbers encoding COLOR in L*a*b* with WHITE-POINT. - - Function: color->l*a*b* color + -- Function: color->l*a*b* color | Returns the list of 3 numbers encoding COLOR in L*a*b*. - - Color Space: L*u*v* + -- Color Space: L*u*v* | Is another CIE encoding designed to better match the human visual system's perception of color. - - Function: l*u*v*->color L*u*v* white-point + -- Function: l*u*v*->color L*u*v* white-point | L*U*V* must be a list of 3 numbers. If L*U*V* is valid L*u*v* coordinates, then `l*u*v*->color' returns the color specified by L*U*V*; otherwise returns #f. - - Function: color:l*u*v* L* u* v* white-point + -- Function: color:l*u*v* L* u* v* white-point | Returns the L*u*v* color composed of L*, U*, V* with WHITE-POINT. - - Function: color:l*u*v* L* u* v* + -- Function: color:l*u*v* L* u* v* | Returns the L*u*v* color composed of L*, U*, V*. If the coordinates do not encode a valid L*u*v* color, then an error is signaled. - - Function: color->l*u*v* color white-point + -- Function: color->l*u*v* color white-point | Returns the list of 3 numbers encoding COLOR in L*u*v* with WHITE-POINT. - - Function: color->l*u*v* color + -- Function: color->l*u*v* color | Returns the list of 3 numbers encoding COLOR in L*u*v*. Cylindrical Coordinates @@ -7023,16 +7672,16 @@ specification of color must be device-dependent. But take heart! A cylindrical system can be based on L*a*b* and is used for predicting how close colors seem to observers. - - Color Space: L*C*h + -- Color Space: L*C*h | Expresses the *a and b* of L*a*b* in polar coordinates. It is a list of three numbers: - * 0 <= L* <= 100 (CIE "Lightness") + * 0 <= L* <= 100 (CIE "Lightness") * C* (CIE "Chroma") is the distance from the neutral (gray) - axis. + axis. - * 0 <= h <= 360 (CIE "Hue") is the angle. + * 0 <= h <= 360 (CIE "Hue") is the angle. The colors by quadrant of h are: @@ -7042,23 +7691,23 @@ close colors seem to observers. 270 blue, purple, magenta 360 - - Function: l*c*h->color L*C*h white-point + -- Function: l*c*h->color L*C*h white-point | L*C*H must be a list of 3 numbers. If L*C*H is valid L*C*h coordinates, then `l*c*h->color' returns the color specified by L*C*H; otherwise returns #f. - - Function: color:l*c*h L* C* h white-point + -- Function: color:l*c*h L* C* h white-point | Returns the L*C*h color composed of L*, C*, H with WHITE-POINT. - - Function: color:l*c*h L* C* h + -- Function: color:l*c*h L* C* h | Returns the L*C*h color composed of L*, C*, H. If the coordinates do not encode a valid L*C*h color, then an error is signaled. - - Function: color->l*c*h color white-point + -- Function: color->l*c*h color white-point | Returns the list of 3 numbers encoding COLOR in L*C*h with WHITE-POINT. - - Function: color->l*c*h color + -- Function: color->l*c*h color | Returns the list of 3 numbers encoding COLOR in L*C*h. Digital Color Spaces @@ -7067,7 +7716,7 @@ Digital Color Spaces The color spaces discussed so far are impractical for image data because of numerical precision and computational requirements. In 1998 the IEC adopted `A Standard Default Color Space for the Internet - sRGB' -(<http://www.w3.org/Graphics/Color/sRGB>). sRGB was cleverly designed +(`http://www.w3.org/Graphics/Color/sRGB'). sRGB was cleverly designed | to employ the 24-bit (256x256x256) color encoding already in widespread use; and the 2.2 gamma intrinsic to CRT monitors. @@ -7077,36 +7726,36 @@ then each coordinate is individually subjected to the same non-linear mapping. Inverse operations in the reverse order create the inverse transform. - - Color Space: sRGB + -- Color Space: sRGB | Is "A Standard Default Color Space for the Internet". Most display monitors will work fairly well with sRGB directly. Systems using ICC profiles (1) should work very well with sRGB. - - Function: srgb->color rgb + -- Function: srgb->color rgb | RGB must be a list of 3 numbers. If RGB is valid sRGB coordinates, then `srgb->color' returns the color specified by RGB; otherwise returns #f. - - Function: color:srgb r g b + -- Function: color:srgb r g b | Returns the sRGB color composed of R, G, B. If the coordinates do not encode a valid sRGB color, then an error is signaled. - - Color Space: xRGB + -- Color Space: xRGB | Represents the equivalent sRGB color with a single 24-bit integer. The most significant 8 bits encode red, the middle 8 bits blue, and the least significant 8 bits green. - - Function: color->srgb color + -- Function: color->srgb color | Returns the list of 3 integers encoding COLOR in sRGB. - - Function: color->xrgb color + -- Function: color->xrgb color | Returns the 24-bit integer encoding COLOR in sRGB. - - Function: xrgb->color k + -- Function: xrgb->color k | Returns the sRGB color composed of the 24-bit integer K. - - Color Space: e-sRGB + -- Color Space: e-sRGB | Is "Photography - Electronic still picture imaging - Extended sRGB color encoding" (PIMA 7667:2001). It extends the gamut of sRGB; and its higher precision numbers provide a larger dynamic range. @@ -7123,34 +7772,32 @@ transform. e-sRGB16 0 to 65535 - - Function: e-srgb->color precision rgb + -- Function: e-srgb->color precision rgb | PRECISION must be the integer 10, 12, or 16. RGB must be a list of 3 numbers. If RGB is valid e-sRGB coordinates, then `e-srgb->color' returns the color specified by RGB; otherwise returns #f. - - Function: color:e-srgb 10 r g b + -- Function: color:e-srgb 10 r g b | Returns the e-sRGB10 color composed of integers R, G, B. - - Function: color:e-srgb 12 r g b + -- Function: color:e-srgb 12 r g b | Returns the e-sRGB12 color composed of integers R, G, B. - - Function: color:e-srgb 16 r g b + -- Function: color:e-srgb 16 r g b | Returns the e-sRGB16 color composed of integers R, G, B. If the coordinates do not encode a valid e-sRGB color, then an error is signaled. - - Function: color->e-srgb precision color + -- Function: color->e-srgb precision color | PRECISION must be the integer 10, 12, or 16. `color->e-srgb' returns the list of 3 integers encoding COLOR in sRGB10, sRGB12, or sRGB16. ---------- Footnotes ---------- - (1) - -A comprehensive encoding of transforms between CIEXYZ and device color -spaces is the International Color Consortium profile format, + (1) A comprehensive encoding of transforms between CIEXYZ and device | +color spaces is the International Color Consortium profile format, | ICC.1:1998-09: The intent of this format is to provide a cross-platform device @@ -7161,8 +7808,8 @@ ICC.1:1998-09: File: slib.info, Node: Spectra, Next: Color Difference Metrics, Prev: Color Spaces, Up: Color -Spectra -------- +5.9.3 Spectra | +------------- | The following functions compute colors from spectra, scale color luminance, and extract chromaticity. XYZ is used in the names of @@ -7182,31 +7829,73 @@ A spectrum may be represented as: CIEXYZ values are calculated as dot-product with the X, Y (Luminance), and Z "Spectral Tristimulus Values". The files `cie1931.xyz' and -`cie1964.xyz' in the distribution contain these CIE-defined values. +`cie1964.xyz' in the distribution contain these CIE-defined values. - - Feature: cie1964 + -- Feature: cie1964 | Loads the Spectral Tristimulus Values defining `CIE 1964 Supplementary Standard Colorimetric Observer'. - - Feature: cie1931 + -- Feature: cie1931 | Loads the Spectral Tristimulus Values defining `CIE 1931 Supplementary Standard Colorimetric Observer'. - - Feature: ciexyz + -- Feature: ciexyz | Requires Spectral Tristimulus Values, defaulting to cie1931. -`(require 'cie1964)' or `(require 'cie1931)' will `load-ciexyz' | -specific values used by the following spectrum conversion procedures. | -The spectrum conversion procedures `(require 'ciexyz)' to assure that a | -set is loaded. | - - - Function: spectrum->XYZ proc +`(require 'cie1964)' or `(require 'cie1931)' will `load-ciexyz' +specific values used by the following spectrum conversion procedures. +The spectrum conversion procedures `(require 'ciexyz)' to assure that a +set is loaded. + + -- Function: read-cie-illuminant path | + PATH must be a string naming a file consisting of 107 numbers for | + 5.nm intervals from 300.nm to 830.nm. `read-cie-illuminant' reads | + (using Scheme `read') these numbers and returns a length 107 | + vector filled with them. | + | + (define CIE:SI-D65 | + (read-CIE-illuminant (in-vicinity (library-vicinity) "ciesid65.dat"))) | + (spectrum->XYZ CIE:SI-D65 300e-9 830e-9) | + => (25.108569422374994 26.418013465625001 28.764075683374993) | + | + -- Function: read-normalized-illuminant path | + PATH must be a string naming a file consisting of 107 numbers for | + 5.nm intervals from 300.nm to 830.nm. | + `read-normalized-illuminant' reads (using Scheme `read') these | + numbers and returns a length 107 vector filled with them, | + normalized so that `spectrum->XYZ' of the illuminant returns its | + whitepoint. | + | + CIE Standard Illuminants A and D65 are included with SLIB: | + | + (define CIE:SI-A | + (read-normalized-illuminant (in-vicinity (library-vicinity) "ciesia.dat"))) + (define CIE:SI-D65 | + (read-normalized-illuminant (in-vicinity (library-vicinity) "ciesid65.dat"))) + (spectrum->XYZ CIE:SI-A 300e-9 830e-9) | + => (1.098499460820401 999.9999999999998e-3 355.8173930654951e-3) | + (CIEXYZ->sRGB (spectrum->XYZ CIE:SI-A 300e-9 830e-9)) | + => (255 234 133) | + (spectrum->XYZ CIE:SI-D65 300e-9 830e-9) | + => (950.4336673552745e-3 1.0000000000000002 1.0888053986649182) | + (CIEXYZ->sRGB (spectrum->XYZ CIE:SI-D65 300e-9 830e-9)) | + => (255 255 255) | + | + -- Function: illuminant-map proc siv | + SIV must be a one-dimensional array or vector of 107 numbers. | + `illuminant-map' returns a vector of length 107 containing the | + result of applying PROC to each element of SIV. | + | + -- Function: illuminant-map->XYZ proc siv | + `(spectrum->XYZ (illuminant-map PROC SIV) 300e-9 830e-9)' | + | + -- Function: spectrum->XYZ proc | PROC must be a function of one argument. `spectrum->XYZ' computes the CIEXYZ(1931) values for the spectrum returned by PROC when called with arguments from 380e-9 to 780e-9, the wavelength in meters. - - Function: spectrum->XYZ spectrum x1 x2 + -- Function: spectrum->XYZ spectrum x1 x2 | X1 and X2 must be positive real numbers specifying the wavelengths (in meters) corresponding to the zeroth and last elements of vector or list SPECTRUM. `spectrum->XYZ' returns the CIEXYZ(1931) @@ -7221,33 +7910,27 @@ set is loaded. | (define y_n (cadr xyz)) (map (lambda (x) (/ x y_n)) xyz) => (0.9687111145512467 1.0 1.1210875945303613) - + (define xyz (spectrum->XYZ (blackbody-spectrum 5000))) (map (lambda (x) (/ x y_n)) xyz) => (0.2933441826889158 0.2988931825387761 0.25783646831201573) - - Function: spectrum->CIEXYZ proc - - Function: spectrum->CIEXYZ spectrum x1 x2 - `spectrum->CIEXYZ' computes the CIEXYZ(1931) values for the - spectrum, scaled so their sum is 1. - - - Function: spectrum->chromaticity proc - - Function: spectrum->chromaticity spectrum x1 x2 + -- Function: spectrum->chromaticity proc | + -- Function: spectrum->chromaticity spectrum x1 x2 | Computes the chromaticity for the given spectrum. - - Function: wavelength->XYZ w - - Function: wavelength->chromaticity w - - Function: wavelength->CIEXYZ w + -- Function: wavelength->XYZ w | W must be a number between 380e-9 to 780e-9. `wavelength->XYZ' returns (unnormalized) XYZ values for a monochromatic light source - with wavelength W. `wavelength->chromaticity' returns the - chromaticity for a monochromatic light source with wavelength W. - `wavelength->CIEXYZ' returns XYZ values for the saturated color - having chromaticity of a monochromatic light source with wavelength - W. - - - Function: blackbody-spectrum temp - - Function: blackbody-spectrum temp span + with wavelength W. | + + -- Function: wavelength->chromaticity w | + W must be a number between 380e-9 to 780e-9. | + `wavelength->chromaticity' returns the chromaticity for a | + monochromatic light source with wavelength W. | + | + -- Function: blackbody-spectrum temp | + -- Function: blackbody-spectrum temp span | Returns a procedure of one argument (wavelength in meters), which returns the radiance of a black body at TEMP. @@ -7256,10 +7939,10 @@ set is loaded. | procedure correspond to the power of the photons with wavelengths W to W+1e-9. - - Function: temperature->XYZ x + -- Function: temperature->XYZ x | The positive number X is a temperature in degrees kelvin. - `temperature->XYZ' computes the CIEXYZ(1931) values for the - spectrum of a black body at temperature X. + `temperature->XYZ' computes the unnormalized CIEXYZ(1931) values | + for the spectrum of a black body at temperature X. | Compute the chromaticities of 6500.K and 5000.K blackbody radiation: @@ -7267,36 +7950,33 @@ set is loaded. | (require 'color-space) (XYZ->chromaticity (temperature->XYZ 6500)) => (0.3135191660557008 0.3236456786200268) - + (XYZ->chromaticity (temperature->XYZ 5000)) => (0.34508082841161052 0.3516084965163377) - - Function: temperature->CIEXYZ x + -- Function: temperature->chromaticity x | The positive number X is a temperature in degrees kelvin. - `temperature->CIEXYZ' computes the CIEXYZ(1931) values for the - spectrum of a black body at temperature X, scaled to be just - inside the RGB709 gamut. + `temperature->cromaticity' computes the chromaticity for the | + spectrum of a black body at temperature X. | - - Function: temperature->chromaticity x | - | - - Function: XYZ:normalize xyz - XYZ is a list of three non-negative real numbers. `XYZ:normalize' - returns a list of numbers proportional to XYZ; scaled so their sum - is 1. + Compute the chromaticities of 6500.K and 5000.K blackbody | + radiation: | + + (require 'color-space) | + (temperature->chromaticity 6500) | + => (0.3135191660557008 0.3236456786200268) | - - Function: XYZ:normalize-colors colors ... - COLORS is a list of XYZ triples. `XYZ:normalize-colors' scales - all the triples by a common factor such that the maximum sum of - numbers in a scaled triple is 1. + (temperature->chromaticity 5000) | + => (0.34508082841161052 0.3516084965163377) | - - Function: XYZ->chromaticity xyz + -- Function: XYZ->chromaticity xyz | Returns a two element list: the x and y components of XYZ normalized to 1 (= X + Y + Z). - - Function: chromaticity->CIEXYZ x y + -- Function: chromaticity->CIEXYZ x y | Returns the list of X, and Y, 1 - Y - X. - - Function: chromaticity->whitepoint x y + -- Function: chromaticity->whitepoint x y | Returns the CIEXYZ(1931) values having luminosity 1 and chromaticity X and Y. @@ -7308,18 +7988,18 @@ obvious range. With no given whitepoint, the only reasonable course is to ascertain the luminance range of a dataset and normalize the values to lie from 0 to 1. - - Function: XYZ->xyY xyz + -- Function: XYZ->xyY xyz | Returns a three element list: the X and Y components of XYZ normalized to 1, and CIE luminance Y. - - Function: xyY->XYZ xyY + -- Function: xyY->XYZ xyY | - - Function: xyY:normalize-colors colors + -- Function: xyY:normalize-colors colors | COLORS is a list of xyY triples. `xyY:normalize-colors' scales each chromaticity so it sums to 1 or less; and divides the Y values by the maximum Y in the dataset, so all lie between 0 and 1. - - Function: xyY:normalize-colors colors n + -- Function: xyY:normalize-colors colors n | If N is positive real, then `xyY:normalize-colors' divides the Y values by N times the maximum Y in the dataset. @@ -7342,33 +8022,33 @@ chromaticities with sums greater than one are scaled to sum to one. File: slib.info, Node: Color Difference Metrics, Next: Color Conversions, Prev: Spectra, Up: Color -Color Difference Metrics ------------------------- +5.9.4 Color Difference Metrics | +------------------------------ | -`(require 'color-space)' | - | - The low-level metric functions operate on lists of 3 numbers, lab1, | -lab2, lch1, or lch2. | - | - `(require 'color)' | - | - The wrapped functions operate on objects of type color, color1 and | -color2 in the function entries. | - | - - Function: L*a*b*:DE* lab1 lab2 | - Returns the Euclidean distance between LAB1 and LAB2. | - | - - Function: CIE:DE* color1 color2 white-point - - Function: CIE:DE* color1 color2 +`(require 'color-space)' + + The low-level metric functions operate on lists of 3 numbers, lab1, +lab2, lch1, or lch2. + + `(require 'color)' + + The wrapped functions operate on objects of type color, color1 and +color2 in the function entries. + + -- Function: L*a*b*:DE* lab1 lab2 | + Returns the Euclidean distance between LAB1 and LAB2. + + -- Function: CIE:DE* color1 color2 white-point | + -- Function: CIE:DE* color1 color2 | Returns the Euclidean distance in L*a*b* space between COLOR1 and COLOR2. - - Function: L*C*h:DE*94 lch1 lch2 parametric-factors | - - Function: L*C*h:DE*94 lch1 lch2 | - - Function: CIE:DE*94 color1 color2 parametric-factors - - Function: CIE:DE*94 color1 color2 - Measures distance in the L*C*h cylindrical color-space. The three | - axes are individually scaled (depending on C*) in their | + -- Function: L*C*h:DE*94 lch1 lch2 parametric-factors | + -- Function: L*C*h:DE*94 lch1 lch2 | + -- Function: CIE:DE*94 color1 color2 parametric-factors | + -- Function: CIE:DE*94 color1 color2 | + Measures distance in the L*C*h cylindrical color-space. The three + axes are individually scaled (depending on C*) in their contributions to the total distance. The CIE has defined reference conditions under which the metric @@ -7399,22 +8079,22 @@ Great Britain created a more sophisticated color-distance function for use in judging the consistency of dye lots. With CMC:DE* it is possible to use a single value pass/fail tolerance for all shades. - - Function: CMC-DE lch1 lch2 parametric-factors | - - Function: CMC-DE lch1 lch2 l c | - - Function: CMC-DE lch1 lch2 l | - - Function: CMC-DE lch1 lch2 | - - Function: CMC:DE* color1 color2 l c - - Function: CMC:DE* color1 color2 - `CMC:DE' is a L*C*h metric. The PARAMETRIC-FACTORS argument is a | - list of 2 numbers L and C. L and C parameterize this metric. 1 | - and 1 are recommended for perceptibility; the default, 2 and 1, | + -- Function: CMC-DE lch1 lch2 parametric-factors | + -- Function: CMC-DE lch1 lch2 l c | + -- Function: CMC-DE lch1 lch2 l | + -- Function: CMC-DE lch1 lch2 | + -- Function: CMC:DE* color1 color2 l c | + -- Function: CMC:DE* color1 color2 | + `CMC:DE' is a L*C*h metric. The PARAMETRIC-FACTORS argument is a + list of 2 numbers L and C. L and C parameterize this metric. 1 + and 1 are recommended for perceptibility; the default, 2 and 1, for acceptability. File: slib.info, Node: Color Conversions, Next: Color Names, Prev: Color Difference Metrics, Up: Color -Color Conversions ------------------ +5.9.5 Color Conversions | +----------------------- | This package contains the low-level color conversion and color metric routines operating on lists of 3 numbers. There is no type or range @@ -7422,54 +8102,54 @@ checking. `(require 'color-space)' - - Constant: CIEXYZ:D65 + -- Constant: CIEXYZ:D65 | Is the color of 6500.K (blackbody) illumination. D65 is close to the average color of daylight. - - Constant: CIEXYZ:D50 + -- Constant: CIEXYZ:D50 | Is the color of 5000.K (blackbody) illumination. D50 is the color of indoor lighting by incandescent bulbs. - - Constant: CIEXYZ:A - - Constant: CIEXYZ:B - - Constant: CIEXYZ:C - - Constant: CIEXYZ:E + -- Constant: CIEXYZ:A | + -- Constant: CIEXYZ:B | + -- Constant: CIEXYZ:C | + -- Constant: CIEXYZ:E | CIE 1931 illuminants normalized to 1 = y. - - Function: color:linear-transform matrix row | - | - - Function: CIEXYZ->RGB709 xyz - - Function: RGB709->CIEXYZ srgb + -- Function: color:linear-transform matrix row | + + -- Function: CIEXYZ->RGB709 xyz | + -- Function: RGB709->CIEXYZ srgb | - - Function: CIEXYZ->L*u*v* xyz white-point - - Function: CIEXYZ->L*u*v* xyz - - Function: L*u*v*->CIEXYZ L*u*v* white-point - - Function: L*u*v*->CIEXYZ L*u*v* + -- Function: CIEXYZ->L*u*v* xyz white-point | + -- Function: CIEXYZ->L*u*v* xyz | + -- Function: L*u*v*->CIEXYZ L*u*v* white-point | + -- Function: L*u*v*->CIEXYZ L*u*v* | The WHITE-POINT defaults to CIEXYZ:D65. - - Function: CIEXYZ->L*a*b* xyz white-point - - Function: CIEXYZ->L*a*b* xyz - - Function: L*a*b*->CIEXYZ L*a*b* white-point - - Function: L*a*b*->CIEXYZ L*a*b* + -- Function: CIEXYZ->L*a*b* xyz white-point | + -- Function: CIEXYZ->L*a*b* xyz | + -- Function: L*a*b*->CIEXYZ L*a*b* white-point | + -- Function: L*a*b*->CIEXYZ L*a*b* | The XYZ WHITE-POINT defaults to CIEXYZ:D65. - - Function: L*a*b*->L*C*h L*a*b* - - Function: L*C*h->L*a*b* L*C*h + -- Function: L*a*b*->L*C*h L*a*b* | + -- Function: L*C*h->L*a*b* L*C*h | - - Function: CIEXYZ->sRGB xyz - - Function: sRGB->CIEXYZ srgb + -- Function: CIEXYZ->sRGB xyz | + -- Function: sRGB->CIEXYZ srgb | - - Function: CIEXYZ->xRGB xyz | - - Function: xRGB->CIEXYZ srgb | - | - - Function: sRGB->xRGB xyz | - - Function: xRGB->sRGB srgb | - | - - Function: CIEXYZ->e-sRGB n xyz - - Function: e-sRGB->CIEXYZ n srgb + -- Function: CIEXYZ->xRGB xyz | + -- Function: xRGB->CIEXYZ srgb | + + -- Function: sRGB->xRGB xyz | + -- Function: xRGB->sRGB srgb | - - Function: sRGB->e-sRGB n srgb - - Function: e-sRGB->sRGB n srgb + -- Function: CIEXYZ->e-sRGB n xyz | + -- Function: e-sRGB->CIEXYZ n srgb | + + -- Function: sRGB->e-sRGB n srgb | + -- Function: e-sRGB->sRGB n srgb | The integer N must be 10, 12, or 16. Because sRGB and e-sRGB use the same RGB709 chromaticities, conversion between them is simpler than conversion through CIEXYZ. @@ -7477,23 +8157,23 @@ checking. Do not convert e-sRGB precision through `e-sRGB->sRGB' then `sRGB->e-sRGB' - values would be truncated to 8-bits! - - Function: e-sRGB->e-sRGB n1 srgb n2 + -- Function: e-sRGB->e-sRGB n1 srgb n2 | The integers N1 and N2 must be 10, 12, or 16. `e-sRGB->e-sRGB' converts SRGB to e-sRGB of precision N2. - | + File: slib.info, Node: Color Names, Next: Daylight, Prev: Color Conversions, Up: Color -Color Names ------------ +5.9.6 Color Names | +----------------- | -`(require 'color-names)' +`(require 'color-names)' Rather than ballast the color dictionaries with numbered grays, `file->color-dictionary' discards them. They are provided through the `grey' procedure: - - Function: grey k + -- Function: grey k | Returns `(inexact->exact (round (* k 2.55)))', the X11 color grey<k>. @@ -7503,37 +8183,37 @@ to color-strings (*note External Representation: Color Data-Type.). The column names in a color dictionary are unimportant; the first field is the key, and the second is the color-string. - - Function: color-name:canonicalize name + -- Function: color-name:canonicalize name | Returns a downcased copy of the string or symbol NAME with `_', `-', and whitespace removed. - - Function: color-name->color name table1 table2 ... + -- Function: color-name->color name table1 table2 ... | TABLE1, TABLE2, ... must be color-dictionary tables. `color-name->color' searches for the canonical form of NAME in TABLE1, TABLE2, ... in order; returning the color-string of the first matching record; #f otherwise. - - Function: color-dictionaries->lookup table1 table2 ... + -- Function: color-dictionaries->lookup table1 table2 ... | TABLE1, TABLE2, ... must be color-dictionary tables. `color-dictionaries->lookup' returns a procedure which searches for the canonical form of its string argument in TABLE1, TABLE2, ...; returning the color-string of the first matching record; and #f otherwise. - - Function: color-dictionary name rdb base-table-type + -- Function: color-dictionary name rdb base-table-type | RDB must be a string naming a relational database file; and the symbol NAME a table therein. The database will be opened as BASE-TABLE-TYPE. `color-dictionary' returns the read-only table NAME in database NAME if it exists; #f otherwise. - - Function: color-dictionary name rdb + -- Function: color-dictionary name rdb | RDB must be an open relational database or a string naming a relational database file; and the symbol NAME a table therein. `color-dictionary' returns the read-only table NAME in database NAME if it exists; #f otherwise. - - Function: load-color-dictionary name rdb base-table-type - - Function: load-color-dictionary name rdb + -- Function: load-color-dictionary name rdb base-table-type | + -- Function: load-color-dictionary name rdb | RDB must be a string naming a relational database file; and the symbol NAME a table therein. If the symbol BASE-TABLE-TYPE is provided, the database will be opened as BASE-TABLE-TYPE. @@ -7546,10 +8226,10 @@ is the key, and the second is the color-string. Dictionary Creation ................... -`(require 'color-database)' | - | - - Function: file->color-dictionary file table-name rdb base-table-type - - Function: file->color-dictionary file table-name rdb +`(require 'color-database)' + + -- Function: file->color-dictionary file table-name rdb base-table-type | + -- Function: file->color-dictionary file table-name rdb | RDB must be an open relational database or a string naming a relational database file, TABLE-NAME a symbol, and the string FILE must name an existing file with colornames and their corresponding @@ -7557,8 +8237,8 @@ Dictionary Creation table TABLE-NAME in RDB and enters the associations found in FILE into it. - - Function: url->color-dictionary url table-name rdb base-table-type - - Function: url->color-dictionary url table-name rdb + -- Function: url->color-dictionary url table-name rdb base-table-type | + -- Function: url->color-dictionary url table-name rdb | RDB must be an open relational database or a string naming a relational database file and TABLE-NAME a symbol. `url->color-dictionary' retrieves the resource named by the string @@ -7568,27 +8248,28 @@ Dictionary Creation This section has detailed the procedures for creating and loading color dictionaries. So where are the dictionaries to load? - `http://swissnet.ai.mit.edu/~jaffer/Color/Dictionaries.html' + `http://swiss.csail.mit.edu/~jaffer/Color/Dictionaries.html' | Describes and evaluates several color-name dictionaries on the web. The following procedure creates a database containing two of these dictionaries. - - Function: make-slib-color-name-db + -- Function: make-slib-color-name-db | Creates an alist-table relational database in library-vicinity containing the "Resene" and "saturate" color-name dictionaries. - If the files `resenecolours.txt' and `saturate.txt' exist in the - library-vicinity, then they used as the source of color-name data. - Otherwise, `make-slib-color-name-db' calls url->color-dictionary - with the URLs of appropriate source files. + If the files `resenecolours.txt', `nbs-iscc.txt', and | + `saturate.txt' exist in the library-vicinity, then they used as | + the source of color-name data. Otherwise, | + `make-slib-color-name-db' calls url->color-dictionary with the | + URLs of appropriate source files. | The Short List .............. -`(require 'saturate)' +`(require 'saturate)' - - Function: saturate name + -- Function: saturate name | Looks for NAME among the 19 saturated colors from `Approximate Colors on CIE Chromaticity Diagram': @@ -7598,7 +8279,7 @@ The Short List purplish blue bluish purple purple reddish purple red purple purplish red red - (<http://swissnet.ai.mit.edu/~jaffer/Color/saturate.pdf>). If + (`http://swiss.csail.mit.edu/~jaffer/Color/saturate.pdf'). If | NAME is found, the corresponding color is returned. Otherwise #f is returned. Use saturate only for light source colors. @@ -7606,11 +8287,11 @@ Resene Paints Limited, New Zealand's largest privately-owned and operated paint manufacturing company, has generously made their `Resene RGB Values List' available. - `(require 'resene)' + `(require 'resene)' - - Function: resene name + -- Function: resene name | Looks for NAME among the 1300 entries in the Resene color-name - dictionary (<http://swissnet.ai.mit.edu/~jaffer/Color/resene.pdf>). + dictionary (`http://swiss.csail.mit.edu/~jaffer/Color/resene.pdf'). | If NAME is found, the corresponding color is returned. Otherwise #f is returned. The `Resene RGB Values List' is an excellent source for surface colors. @@ -7634,7 +8315,7 @@ program, then you must include its license with your program: copyright notice in the documentation or other materials provided with the distribution. - 3. Resene Paints Ltd makes no warranty or representation that | + 3. Resene Paints Ltd makes no warranty or representation that this dictionary is error-free, and is under no obligation to provide any services, by way of maintenance, update, or otherwise. @@ -7649,26 +8330,26 @@ program, then you must include its license with your program: File: slib.info, Node: Daylight, Prev: Color Names, Up: Color -Daylight --------- +5.9.7 Daylight | +-------------- | -`(require 'daylight)' +`(require 'daylight)' This package calculates the colors of sky as detailed in: `http://www.cs.utah.edu/vissim/papers/sunsky/sunsky.pdf' `A Practical Analytic Model for Daylight' A. J. Preetham, Peter Shirley, Brian Smits - - Function: solar-hour julian-day hour + -- Function: solar-hour julian-day hour | Returns the solar-time in hours given the integer JULIAN-DAY in the range 1 to 366, and the local time in hours. To be meticulous, subtract 4 minutes for each degree of longitude west of the standard meridian of your time zone. - - Function: solar-declination julian-day + -- Function: solar-declination julian-day | - - Function: solar-polar declination latitude solar-hour + -- Function: solar-polar declination latitude solar-hour | Returns a list of THETA_S, the solar angle from the zenith, and PHI_S, the solar azimuth. 0 <= THETA_S measured in degrees. PHI_S is measured in degrees from due south; west of south being @@ -7706,24 +8387,20 @@ turbidity values less than 1.3. 1 2 4 8 16 32 64 Meterorological range (km) versus Turbidity - - Function: sunlight-spectrum turbidity theta_s + -- Function: sunlight-spectrum turbidity theta_s | Returns a vector of 41 values, the spectrum of sunlight from 380.nm to 790.nm for a given TURBIDITY and THETA_S. - - Function: sunlight-xyz turbidity theta_s - Returns (unnormalized) XYZ values for color of sunlight for a - given TURBIDITY and THETA_S. + -- Function: sunlight-chromaticity turbidity theta_s | + Given TURBIDITY and THETA_S, `sunlight-chromaticity' returns the | + CIEXYZ triple for color of sunlight scaled to be just inside the | + RGB709 gamut. | - - Function: sunlight-ciexyz turbidity theta_s - Given TURBIDITY and THETA_S, `sunlight-ciexyz' returns the CIEXYZ - triple for color of sunlight scaled to be just inside the RGB709 - gamut. - - - Function: zenith-xyy turbidity theta_s + -- Function: zenith-xyy turbidity theta_s | Returns the xyY (chromaticity and luminance) at the zenith. The Luminance has units kcd/m^2. - - Function: overcast-sky-color-xyy turbidity theta_s + -- Function: overcast-sky-color-xyy turbidity theta_s | TURBIDITY is a positive real number expressing the amount of light scattering. The real number THETA_S is the solar angle from the zenith in degrees. @@ -7733,8 +8410,8 @@ turbidity values less than 1.3. and returning the xyY value for light coming from that elevation of the sky. - - Function: clear-sky-color-xyy turbidity theta_s phi_s - - Function: sky-color-xyy turbidity theta_s phi_s + -- Function: clear-sky-color-xyy turbidity theta_s phi_s | + -- Function: sky-color-xyy turbidity theta_s phi_s | TURBIDITY is a positive real number expressing the amount of light scattering. The real number THETA_S is the solar angle from the zenith in degrees. The real number PHI_S is the solar angle from @@ -7751,33 +8428,33 @@ turbidity values less than 1.3. File: slib.info, Node: Root Finding, Next: Minimizing, Prev: Color, Up: Mathematical Packages -Root Finding -============ +5.10 Root Finding | +================= | -`(require 'root)' +`(require 'root)' - - Function: newton:find-integer-root f df/dx x0 + -- Function: newton: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 closer to zero than either of the integers adjacent to X; or returns `#f' if such an integer can't be found. - To find the closest integer to a given integers square root: + To find the closest integer to a given integer's square root: | (define (integer-sqrt y) (newton:find-integer-root (lambda (x) (- (* x x) y)) (lambda (x) (* 2 x)) (ash 1 (quotient (integer-length y) 2)))) - + (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)) @@ -7794,7 +8471,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 @@ -7805,7 +8482,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 @@ -7817,8 +8494,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. @@ -7846,10 +8523,10 @@ Polynomials', IEEE Transactions on Circuits and Systems, Vol. 36, No. File: slib.info, Node: Minimizing, Next: Commutative Rings, Prev: Root Finding, Up: Mathematical Packages -Minimizing -========== +5.11 Minimizing | +=============== | -`(require 'minimize)' +`(require 'minimize)' The Golden Section Search (1) algorithm finds minima of functions which are expensive to compute or for which derivatives are not available. @@ -7860,7 +8537,7 @@ 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 + -- 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 @@ -7893,27 +8570,27 @@ and Software' Prentice-Hall, 1989, ISBN 0-13-627258-4 File: slib.info, Node: Commutative Rings, Next: Matrix Algebra, Prev: Minimizing, Up: Mathematical Packages -Commutative Rings -================= +5.12 Commutative Rings | +====================== | Scheme provides a consistent and capable set of numeric functions. Inexacts implement a field; integers a commutative ring (and Euclidean domain). This package allows one to use basic Scheme numeric functions with symbols and non-numeric elements of commutative rings. - `(require 'commutative-ring)' + `(require 'commutative-ring)' The "commutative-ring" package makes the procedures `+', `-', `*', `/', and `^' "careful" in the sense that any non-numeric arguments they do not reduce appear in the expression output. In order to see what working with this package is like, self-set all the single letter -identifiers (to their corresponding symbols). +identifiers (to their corresponding symbols). (define a 'a) ... (define z 'z) - Or just `(require 'self-set)'. Now try some sample expressions: + Or just `(require 'self-set)'. Now try some sample expressions: (+ (+ a b) (- a b)) => (* a 2) (* (+ a b) (+ a b)) => (^ (+ a b) 2) @@ -7930,7 +8607,7 @@ multiplication converted to multiplication and exponentiation. We can enable distributive rules, thus expanding to sum of products form: (set! *ruleset* (combined-rulesets distribute* distribute/)) - + (* (+ a b) (+ a b)) => (+ (* 2 a b) (^ a 2) (^ b 2)) (* (+ a b) (- a b)) => (- (^ a 2) (^ b 2)) (* (- a b) (- a b)) => (- (+ (^ a 2) (^ b 2)) (* 2 a b)) @@ -7946,7 +8623,7 @@ form: expressions: (require 'determinant) - + (determinant '((a b c) (d e f) (g h i))) => (- (+ (* a e i) (* b f g) (* c d h)) (* a f h) (* b d i) (* c e g)) @@ -7957,30 +8634,30 @@ expressions are handled similarly. This list might be extended to include `quotient', `modulo', `remainder', `lcm', and `gcd'; but these work only for the more -restrictive Euclidean (Unique Factorization) Domain. +restrictive Euclidean (Unique Factorization) Domain. -Rules and Rulesets -================== +5.13 Rules and Rulesets | +======================= | The "commutative-ring" package allows control of ring properties through the use of "rulesets". - - Variable: *ruleset* + -- Variable: *ruleset* | Contains the set of rules currently in effect. Rules defined by `cring:define-rule' are stored within the value of *ruleset* at the 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 @@ -7989,11 +8666,11 @@ through the use of "rulesets". Two rulesets are defined by this package. - - Constant: distribute* + -- Constant: distribute* | Contains the ruleset to distribute multiplication over addition and subtraction. - - Constant: distribute/ + -- Constant: distribute/ | Contains the ruleset to distribute division over addition and subtraction. @@ -8005,14 +8682,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 @@ -8033,8 +8710,8 @@ involving different non-numeric elements. (lambda (exp1 exp2) (apply + (map (lambda (trm) (* trm exp2)) (cdr exp1)))))) -How to Create a Commutative Ring -================================ +5.14 How to Create a Commutative Ring | +===================================== | The first step in creating your commutative ring is to write procedures to create elements of the ring. A non-numeric element of the ring must @@ -8050,9 +8727,9 @@ symbol whose top-level value is the procedure to create it. ((not (term< (first list1) (last1 list1))) (apply n (reverse list1))) (else (cons 'n list1)))) - + (define (s x y) (n x y)) - + (define (m . list1) (cond ((neq? (first list1) (term_min list1)) (apply m (cyclicrotate list1))) @@ -8113,7 +8790,7 @@ have _not_ been defined are not changed. (eq? (first list1) (last1 list2))) (butlast (splice list1 list2) 1)) (else (slib:error 'cyclicsplice list1 list2)))) - + (N*N (S a b) (S a b)) => (m a b) Then register the rule for multiplying type N objects by type N @@ -8172,21 +8849,21 @@ objects. File: slib.info, Node: Matrix Algebra, Prev: Commutative Rings, Up: Mathematical Packages -Matrix Algebra -============== +5.15 Matrix Algebra | +=================== | -`(require 'determinant)' +`(require 'determinant)' -A Matrix can be either a list of lists (rows) or an array. As with -linear-algebra texts, this package uses 1-based coordinates. +A Matrix can be either a list of lists (rows) or an array. Unlike | +linear-algebra texts, this package uses 0-based coordinates. | - - Function: matrix->lists matrix + -- Function: matrix->lists matrix | Returns the list-of-lists form of MATRIX. - - Function: matrix->array matrix + -- Function: matrix->array matrix | Returns the (ones-based) array form of MATRIX. - - Function: determinant matrix + -- Function: determinant matrix | MATRIX must be a square matrix. `determinant' returns the determinant of MATRIX. @@ -8194,14 +8871,14 @@ linear-algebra texts, this package uses 1-based coordinates. (determinant '((1 2) (3 4))) => -2 (determinant '((1 2 3) (4 5 6) (7 8 9))) => 0 - - Function: transpose matrix + -- Function: transpose matrix | Returns a copy of MATRIX flipped over the diagonal containing the 1,1 element. - - Function: matrix:product m1 m2 + -- Function: matrix:product m1 m2 | Returns the product of matrices M1 and M2. - - Function: matrix:inverse matrix + -- Function: matrix:inverse matrix | MATRIX must be a square matrix. If MATRIX is singlar, then `matrix:inverse' returns #f; otherwise `matrix:inverse' returns the `matrix:product' inverse of MATRIX. @@ -8209,22 +8886,22 @@ linear-algebra texts, this package uses 1-based coordinates. File: slib.info, Node: Database Packages, Next: Other Packages, Prev: Mathematical Packages, Up: Top -Database Packages -***************** +6 Database Packages | +******************* | * Menu: - | + * Relational Database:: 'relational-database -* Relational Infrastructure:: | +* Relational Infrastructure:: * Weight-Balanced Trees:: 'wt-tree File: slib.info, Node: Relational Database, Next: Relational Infrastructure, Prev: Database Packages, Up: Database Packages - | -Relational Database -=================== -`(require 'relational-database)' +6.1 Relational Database | +======================= | + +`(require 'relational-database)' This package implements a database system inspired by the Relational Model (`E. F. Codd, A Relational Model of Data for Large Shared Data @@ -8232,24 +8909,24 @@ Banks'). An SLIB relational database implementation can be created from any *Note Base Table:: implementation. Why relational database? For motivations and design issues see -`http://swissnet.ai.mit.edu/~jaffer/DBManifesto.html'. +`http://swiss.csail.mit.edu/~jaffer/DBManifesto.html'. | * Menu: -* Using Databases:: 'databases | +* Using Databases:: 'databases * Table Operations:: -* Database Interpolation:: 'database-interpolate | +* Database Interpolation:: 'database-interpolate * Embedded Commands:: 'database-commands -* Database Macros:: 'within-database | +* Database Macros:: 'within-database * Database Browser:: 'database-browse File: slib.info, Node: Using Databases, Next: Table Operations, Prev: Relational Database, Up: Relational Database - | -Using Databases ---------------- -`(require 'databases)' +6.1.1 Using Databases | +--------------------- | + +`(require 'databases)' This enhancement wraps a utility layer on `relational-database' which provides: @@ -8285,58 +8962,58 @@ Database Operations::. Except for `create-database', each procedure will accept either a filename or database procedure for its first argument. - - Function: create-database filename base-table-type - FILENAME should be a string naming a file; or `#f'. | - BASE-TABLE-TYPE must be a symbol naming a feature which can be | - passed to `require'. `create-database' returns a new, open | - relational database (with base-table type BASE-TABLE-TYPE) | - associated with FILENAME, or a new ephemeral database if FILENAME | - is `#f'. | + -- Function: create-database filename base-table-type | + FILENAME should be a string naming a file; or `#f'. + BASE-TABLE-TYPE must be a symbol naming a feature which can be + passed to `require'. `create-database' returns a new, open + relational database (with base-table type BASE-TABLE-TYPE) + associated with FILENAME, or a new ephemeral database if FILENAME + is `#f'. - `create-database' is the only run-time use of require in SLIB | - which crosses module boundaries. When BASE-TABLE-TYPE is | - `require'd by `create-database'; it adds an association of | - BASE-TABLE-TYPE with its "relational-system" procedure to | - MDBM:*DATABASES*. | + `create-database' is the only run-time use of require in SLIB + which crosses module boundaries. When BASE-TABLE-TYPE is + `require'd by `create-database'; it adds an association of + BASE-TABLE-TYPE with its "relational-system" procedure to + MDBM:*DATABASES*. - alist-table is the default base-table type: | - | - (require 'databases) | - (define my-rdb (create-database "my.db" 'alist-table)) | - | -Only `alist-table' and base-table modules which have been `require'd | -will dispatch correctly from the `open-database' procedures. | -Therefore, either pass two arguments to `open-database', or require the | -base-table of your database file uses before calling `open-database' | -with one argument. | - | - - Procedure: open-database! rdb base-table-type | + alist-table is the default base-table type: + + (require 'databases) + (define my-rdb (create-database "my.db" 'alist-table)) + +Only `alist-table' and base-table modules which have been `require'd +will dispatch correctly from the `open-database' procedures. +Therefore, either pass two arguments to `open-database', or require the +base-table of your database file uses before calling `open-database' +with one argument. + + -- Procedure: open-database! rdb base-table-type | Returns _mutable_ open relational database or #f. - - Function: open-database rdb base-table-type + -- Function: open-database rdb base-table-type | Returns an open relational database associated with RDB. The database will be opened with base-table type BASE-TABLE-TYPE). - - Function: open-database rdb + -- Function: open-database rdb | Returns an open relational database associated with RDB. `open-database' will attempt to deduce the correct base-table-type. - - Function: write-database rdb filename + -- Function: write-database rdb filename | Writes the mutable relational-database RDB to FILENAME. - - Function: sync-database rdb + -- Function: sync-database rdb | Writes the mutable relational-database RDB to the filename it was opened with. - - Function: solidify-database rdb + -- Function: solidify-database rdb | Syncs RDB and makes it immutable. - - Function: close-database rdb + -- Function: close-database rdb | RDB will only be closed when the count of `open-database' - `close-database' calls for RDB (and its filename) is 0. `close-database' returns #t if successful; and #f otherwise. - - Function: mdbm:report + -- Function: mdbm:report | Prints a table of open database files. The columns are the base-table type, number of opens, `!' for mutable, the filename, and the lock certificate (if locked). @@ -8346,37 +9023,37 @@ with one argument. | alist-table 003 /usr/local/lib/slib/clrnamdb.scm alist-table 001 ! sdram.db jaffer@aubrey.jaffer.3166:1038628199 -Opening Tables | -.............. | - | - - Function: open-table rdb table-name | - RDB must be a relational database and TABLE-NAME a symbol. | - | - `open-table' returns a "methods" procedure for an existing | - relational table in RDB if it exists and can be opened for | - reading, otherwise returns `#f'. | - | - - Procedure: open-table! rdb table-name | - RDB must be a relational database and TABLE-NAME a symbol. | - | - `open-table!' returns a "methods" procedure for an existing | - relational table in RDB if it exists and can be opened in mutable | - mode, otherwise returns `#f'. | - | +Opening Tables +.............. + + -- Function: open-table rdb table-name | + RDB must be a relational database and TABLE-NAME a symbol. + + `open-table' returns a "methods" procedure for an existing + relational table in RDB if it exists and can be opened for + reading, otherwise returns `#f'. + + -- Procedure: open-table! rdb table-name | + RDB must be a relational database and TABLE-NAME a symbol. + + `open-table!' returns a "methods" procedure for an existing + relational table in RDB if it exists and can be opened in mutable + mode, otherwise returns `#f'. + Defining Tables ............... - - Function: define-domains rdb row5 ... | - Adds the domain rows ROW5 ... to the `*domains-data*' table in | + -- Function: define-domains rdb row5 ... | + Adds the domain rows ROW5 ... to the `*domains-data*' table in RDB. The format of the row is given in *Note Catalog - Representation::. | - | - (define-domains rdb '(permittivity #f complex? c64 #f)) | - | - - Function: add-domain rdb row5 | - Use `define-domains' instead. | - | - - Function: define-tables rdb spec-0 ... + Representation::. + + (define-domains rdb '(permittivity #f complex? c64 #f)) + + -- Function: add-domain rdb row5 | + Use `define-domains' instead. + + -- Function: define-tables rdb spec-0 ... | Adds tables as specified in SPEC-0 ... to the open relational-database RDB. Each SPEC has the form: @@ -8404,12 +9081,12 @@ Defining Tables If <domain> is not a defined domain name and it matches the name of this table or an already defined (in one of SPEC-0 ...) single key - field table, a foreign-key domain will be created for it. | + field table, a foreign-key domain will be created for it. Listing Tables .............. - - Function: list-table-definition rdb table-name + -- Function: 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 @@ -8420,57 +9097,57 @@ Listing Tables File: slib.info, Node: Table Operations, Next: Database Interpolation, Prev: Using Databases, Up: Relational Database - | -Table Operations | ----------------- | + +6.1.2 Table Operations | +---------------------- | These are the descriptions of the methods available from an open -relational table. A method is retrieved from a table by calling the | -table with the symbol name of the operation. For example: | +relational table. A method is retrieved from a table by calling the +table with the symbol name of the operation. For example: - ((plat 'get 'processor) 'djgpp) => i386 | + ((plat 'get 'processor) 'djgpp) => i386 -Some operations described below require primary key arguments. Primary | -keys arguments are denoted KEY1 KEY2 .... It is an error to call an | -operation for a table which takes primary key arguments with the wrong | -number of primary keys for that table. | +Some operations described below require primary key arguments. Primary +keys arguments are denoted KEY1 KEY2 .... It is an error to call an +operation for a table which takes primary key arguments with the wrong +number of primary keys for that table. - - Operation on relational-table: 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 | - `#f' otherwise. | + -- Operation on relational-table: 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 + `#f' otherwise. - ((plat 'get 'processor) 'djgpp) => i386 | - ((plat 'get 'processor) 'be-os) => #f | + ((plat 'get 'processor) 'djgpp) => i386 + ((plat 'get 'processor) 'be-os) => #f -* Menu: | +* Menu: -* Single Row Operations:: | -* Match-Keys:: | -* Multi-Row Operations:: | -* Indexed Sequential Access Methods:: | -* Sequential Index Operations:: | -* Table Administration:: | +* Single Row Operations:: +* Match-Keys:: +* Multi-Row Operations:: +* Indexed Sequential Access Methods:: +* Sequential Index Operations:: +* Table Administration:: File: slib.info, Node: Single Row Operations, Next: Match-Keys, Prev: Table Operations, Up: Table Operations - | -Single Row Operations | -..................... | -The term "row" used below refers to a Scheme list of values (one for | -each column) in the order specified in the descriptor (table) for this | -table. Missing values appear as `#f'. Primary keys must not be | -missing. | - | - - Operation on relational-table: row:insert | - Adds the row ROW to this table. If a row for the primary key(s) | - specified by ROW already exists in this table an error is | - signaled. The value returned is unspecified. | +6.1.2.1 Single Row Operations | +............................. | + +The term "row" used below refers to a Scheme list of values (one for +each column) in the order specified in the descriptor (table) for this +table. Missing values appear as `#f'. Primary keys must not be +missing. + + -- Operation on relational-table: row:insert | + Adds the row ROW to this table. If a row for the primary key(s) + specified by ROW already exists in this table an error is + signaled. The value returned is unspecified. (define telephone-table-desc - ((my-database 'create-table) 'telephone-table-desc)) | + ((my-database 'create-table) 'telephone-table-desc)) (define ndrp (telephone-table-desc 'row:insert)) (ndrp '(1 #t name #f string)) (ndrp '(2 #f telephone @@ -8483,93 +9160,93 @@ missing. | (string->list d)))) string)) - - Operation on relational-table: row:update | - Returns a procedure of one argument, ROW, which adds the row, ROW, | - to this table. If a row for the primary key(s) specified by ROW | - already exists in this table, it will be overwritten. The value | - returned is unspecified. | + -- Operation on relational-table: row:update | + Returns a procedure of one argument, ROW, which adds the row, ROW, + to this table. If a row for the primary key(s) specified by ROW + already exists in this table, it will be overwritten. The value + returned is unspecified. - - Operation on relational-table: row:retrieve | + -- Operation on relational-table: row:retrieve | Returns a procedure of arguments KEY1 KEY2 ... which returns the - row associated with primary keys KEY1, KEY2 ... if it exists, or | + row associated with primary keys KEY1, KEY2 ... if it exists, or `#f' otherwise. - ((plat 'row:retrieve) 'linux) => (linux i386 linux gcc) | - ((plat 'row:retrieve) 'multics) => #f | + ((plat 'row:retrieve) 'linux) => (linux i386 linux gcc) + ((plat 'row:retrieve) 'multics) => #f + + -- Operation on relational-table: row:remove | + Returns a procedure of arguments KEY1 KEY2 ... which removes and + returns the row associated with primary keys KEY1, KEY2 ... if it + exists, or `#f' otherwise. + + -- Operation on relational-table: row:delete | + Returns a procedure of arguments KEY1 KEY2 ... which deletes the + row associated with primary keys KEY1, KEY2 ... if it exists. The + value returned is unspecified. - - Operation on relational-table: row:remove | - Returns a procedure of arguments KEY1 KEY2 ... which removes and | - returns the row associated with primary keys KEY1, KEY2 ... if it | - exists, or `#f' otherwise. | - | - - Operation on relational-table: row:delete | - Returns a procedure of arguments KEY1 KEY2 ... which deletes the | - row associated with primary keys KEY1, KEY2 ... if it exists. The | - value returned is unspecified. | - | File: slib.info, Node: Match-Keys, Next: Multi-Row Operations, Prev: Single Row Operations, Up: Table Operations - | -Match-Keys | -.......... | - | -The (optional) MATCH-KEY1 ... arguments are used to restrict actions of | -a whole-table operation to a subset of that table. Those procedures | -(returned by methods) which accept match-key arguments will accept any | -number of match-key arguments between zero and the number of primary | -keys in the table. Any unspecified MATCH-KEY arguments default to `#f'. | - | -The MATCH-KEY1 ... restrict the actions of the table command to those | -records whose primary keys each satisfy the corresponding MATCH-KEY | -argument. The arguments and their actions are: | - | - `#f' | - The false value matches any key in the corresponding position. | - | - an object of type procedure | - This procedure must take a single argument, the key in the | - corresponding position. Any key for which the procedure | - returns a non-false value is a match; Any key for which the | - procedure returns a `#f' is not. | - | - other values | - Any other value matches only those keys `equal?' to it. | - | - - Operation on relational-table: get* column-name | + +6.1.2.2 Match-Keys | +.................. | + +The (optional) MATCH-KEY1 ... arguments are used to restrict actions of +a whole-table operation to a subset of that table. Those procedures +(returned by methods) which accept match-key arguments will accept any +number of match-key arguments between zero and the number of primary +keys in the table. Any unspecified MATCH-KEY arguments default to `#f'. + +The MATCH-KEY1 ... restrict the actions of the table command to those +records whose primary keys each satisfy the corresponding MATCH-KEY +argument. The arguments and their actions are: + + `#f' + The false value matches any key in the corresponding position. + + an object of type procedure + This procedure must take a single argument, the key in the + corresponding position. Any key for which the procedure + returns a non-false value is a match; Any key for which the + procedure returns a `#f' is not. + + other values + Any other value matches only those keys `equal?' to it. + + -- Operation on relational-table: 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 - actions to a subset of the table. | + actions to a subset of the table. ((plat 'get* 'processor)) => - (i386 i8086 i386 i8086 i386 i386 i8086 m68000 | + (i386 i8086 i386 i8086 i386 i386 i8086 m68000 m68000 m68000 m68000 m68000 powerpc) - + ((plat 'get* 'processor) #f) => - (i386 i8086 i386 i8086 i386 i386 i8086 m68000 | + (i386 i8086 i386 i8086 i386 i386 i8086 m68000 m68000 m68000 m68000 m68000 powerpc) - + (define (a-key? key) (char=? #\a (string-ref (symbol->string key) 0))) - + ((plat 'get* 'processor) a-key?) => (m68000 m68000 m68000 m68000 m68000 powerpc) - + ((plat 'get* 'name) a-key?) => (atari-st-turbo-c atari-st-gcc amiga-sas/c-5.10 amiga-aztec amiga-dice-c aix) File: slib.info, Node: Multi-Row Operations, Next: Indexed Sequential Access Methods, Prev: Match-Keys, Up: Table Operations - | -Multi-Row Operations | -.................... | - - Operation on relational-table: row:retrieve* | +6.1.2.3 Multi-Row Operations | +............................ | + + -- Operation on relational-table: row:retrieve* | Returns a procedure of optional arguments MATCH-KEY1 ... which returns a list of all rows in this table. The optional MATCH-KEY1 - ... arguments restrict actions to a subset of the table. For | - details see *Note Match-Keys::. | + ... arguments restrict actions to a subset of the table. For + details see *Note Match-Keys::. ((plat 'row:retrieve*) a-key?) => ((atari-st-turbo-c m68000 atari turbo-c) @@ -8579,171 +9256,171 @@ Multi-Row Operations | (amiga-dice-c m68000 amiga dice-c) (aix powerpc aix -)) - - Operation on relational-table: row:remove* | + -- Operation on relational-table: row:remove* | Returns a procedure of optional arguments MATCH-KEY1 ... which removes and returns a list of all rows in this table. The optional - MATCH-KEY1 ... arguments restrict actions to a subset of the table. | + MATCH-KEY1 ... arguments restrict actions to a subset of the table. - - Operation on relational-table: row:delete* | + -- Operation on relational-table: row:delete* | Returns a procedure of optional arguments MATCH-KEY1 ... which Deletes all rows from this table. The optional MATCH-KEY1 ... - arguments restrict deletions to a subset of the table. The value | - returned is unspecified. The descriptor table and catalog entry | - for this table are not affected. | + arguments restrict deletions to a subset of the table. The value + returned is unspecified. The descriptor table and catalog entry + for this table are not affected. - - Operation on relational-table: for-each-row | - Returns a procedure of arguments PROC MATCH-KEY1 ... which calls | - PROC with each ROW in this table. The optional MATCH-KEY1 ... | - arguments restrict actions to a subset of the table. For details | - see *Note Match-Keys::. | + -- Operation on relational-table: for-each-row | + Returns a procedure of arguments PROC MATCH-KEY1 ... which calls + PROC with each ROW in this table. The optional MATCH-KEY1 ... + arguments restrict actions to a subset of the table. For details + see *Note Match-Keys::. -Note that `row:insert*' and `row:update*' do _not_ use match-keys. | - | - - Operation on relational-table: row:insert* | +Note that `row:insert*' and `row:update*' do _not_ use match-keys. + + -- Operation on relational-table: row:insert* | Returns a procedure of one argument, ROWS, which adds each row in the list of rows, ROWS, to this table. If a row for the primary key specified by an element of ROWS already exists in this table, - an error is signaled. The value returned is unspecified. | + an error is signaled. The value returned is unspecified. - - Operation on relational-table: row:update* | + -- Operation on relational-table: row:update* | Returns a procedure of one argument, ROWS, which adds each row in the list of rows, ROWS, to this table. If a row for the primary key specified by an element of ROWS already exists in this table, - it will be overwritten. The value returned is unspecified. | + it will be overwritten. The value returned is unspecified. File: slib.info, Node: Indexed Sequential Access Methods, Next: Sequential Index Operations, Prev: Multi-Row Operations, Up: Table Operations - | -Indexed Sequential Access Methods | -................................. | - | -"Indexed Sequential Access Methods" are a way of arranging database | -information so that records can be accessed both by key and by key | -sequence (ordering). "ISAM" is not part of Codd's relational model. | -Hardcore relational programmers might use some least-upper-bound join | -for every row to get them into an order. | - | -Associative memory in B-Trees is an example of a database | -implementation which can support a native key ordering. SLIB's | -`alist-table' implementation uses `sort' to implement | -`for-each-row-in-order', but does not support `isam-next' and | -`isam-prev'. | - | -The multi-primary-key ordering employed by these operations is the | -lexicographic collation of those primary-key fields in their given | -order. For example: | - | - (12 a 34) < (12 a 36) < (12 b 1) < (13 a 0) | - | + +6.1.2.4 Indexed Sequential Access Methods | +......................................... | + +"Indexed Sequential Access Methods" are a way of arranging database +information so that records can be accessed both by key and by key +sequence (ordering). "ISAM" is not part of Codd's relational model. +Hardcore relational programmers might use some least-upper-bound join +for every row to get them into an order. + +Associative memory in B-Trees is an example of a database +implementation which can support a native key ordering. SLIB's +`alist-table' implementation uses `sort' to implement +`for-each-row-in-order', but does not support `isam-next' and +`isam-prev'. + +The multi-primary-key ordering employed by these operations is the +lexicographic collation of those primary-key fields in their given +order. For example: + + (12 a 34) < (12 a 36) < (12 b 1) < (13 a 0) + File: slib.info, Node: Sequential Index Operations, Next: Table Administration, Prev: Indexed Sequential Access Methods, Up: Table Operations - | -Sequential Index Operations | -........................... | - | -The following procedures are individually optional depending on the | -base-table implememtation. If an operation is _not_ supported, then | -calling the table with that operation symbol will return false. | - | - - Operation on relational-table: for-each-row-in-order | + +6.1.2.5 Sequential Index Operations | +................................... | + +The following procedures are individually optional depending on the +base-table implememtation. If an operation is _not_ supported, then +calling the table with that operation symbol will return false. + + -- Operation on relational-table: for-each-row-in-order | Returns a procedure of arguments PROC MATCH-KEY1 ... which calls PROC with each ROW in this table in the (implementation-dependent) - natural, repeatable ordering for rows. The optional MATCH-KEY1 | - ... arguments restrict actions to a subset of the table. For | - details see *Note Match-Keys::. | - - - Operation on relational-table: isam-next | - Returns a procedure of arguments KEY1 KEY2 ... which returns the | - key-list identifying the lowest record higher than KEY1 KEY2 ... | - which is stored in the relational-table; or false if no higher | - record is present. | - - - Operation on relational-table: isam-next column-name | - The symbol COLUMN-NAME names a key field. In the list returned by | - `isam-next', that field, or a field to its left, will be changed. | - This allows one to skip over less significant key fields. | - - - Operation on relational-table: isam-prev | - Returns a procedure of arguments KEY1 KEY2 ... which returns the | - key-list identifying the highest record less than KEY1 KEY2 ... | - which is stored in the relational-table; or false if no lower | - record is present. | - - - Operation on relational-table: isam-prev index | - The symbol COLUMN-NAME names a key field. In the list returned by | - `isam-next', that field, or a field to its left, will be changed. | - This allows one to skip over less significant key fields. | - - For example, if a table has key fields: | - (col1 col2) | - (9 5) | - (9 6) | - (9 7) | - (9 8) | - (12 5) | - (12 6) | - (12 7) | - - Then: | - ((table 'isam-next) '(9 5)) => (9 6) | - ((table 'isam-next 'col2) '(9 5)) => (9 6) | - ((table 'isam-next 'col1) '(9 5)) => (12 5) | - ((table 'isam-prev) '(12 7)) => (12 6) | - ((table 'isam-prev 'col2) '(12 7)) => (12 6) | - ((table 'isam-prev 'col1) '(12 7)) => (9 8) | + natural, repeatable ordering for rows. The optional MATCH-KEY1 + ... arguments restrict actions to a subset of the table. For + details see *Note Match-Keys::. + + -- Operation on relational-table: isam-next | + Returns a procedure of arguments KEY1 KEY2 ... which returns the + key-list identifying the lowest record higher than KEY1 KEY2 ... + which is stored in the relational-table; or false if no higher + record is present. + + -- Operation on relational-table: isam-next column-name | + The symbol COLUMN-NAME names a key field. In the list returned by + `isam-next', that field, or a field to its left, will be changed. + This allows one to skip over less significant key fields. + + -- Operation on relational-table: isam-prev | + Returns a procedure of arguments KEY1 KEY2 ... which returns the + key-list identifying the highest record less than KEY1 KEY2 ... + which is stored in the relational-table; or false if no lower + record is present. + + -- Operation on relational-table: isam-prev column-name | + The symbol COLUMN-NAME names a key field. In the list returned by + `isam-next', that field, or a field to its left, will be changed. + This allows one to skip over less significant key fields. + + For example, if a table has key fields: + (col1 col2) + (9 5) + (9 6) + (9 7) + (9 8) + (12 5) + (12 6) + (12 7) + + Then: + ((table 'isam-next) '(9 5)) => (9 6) + ((table 'isam-next 'col2) '(9 5)) => (9 6) + ((table 'isam-next 'col1) '(9 5)) => (12 5) + ((table 'isam-prev) '(12 7)) => (12 6) + ((table 'isam-prev 'col2) '(12 7)) => (12 6) + ((table 'isam-prev 'col1) '(12 7)) => (9 8) File: slib.info, Node: Table Administration, Prev: Sequential Index Operations, Up: Table Operations - | -Table Administration | -.................... | - | - - Operation on relational-table: column-names | - - Operation on relational-table: column-foreigns | - - Operation on relational-table: column-domains | - - Operation on relational-table: column-types | + +6.1.2.6 Table Administration | +............................ | + + -- Operation on relational-table: column-names | + -- Operation on relational-table: column-foreigns | + -- Operation on relational-table: column-domains | + -- Operation on relational-table: column-types | Return a list of the column names, foreign-key table names, domain names, or type names respectively for this table. These 4 methods are different from the others in that the list is returned, rather than a procedure to obtain the list. - - Operation on relational-table: primary-limit | + -- Operation on relational-table: primary-limit | Returns the number of primary keys fields in the relations in this table. - - Operation on relational-table: close-table | - Subsequent operations to this table will signal an error. | - | + -- Operation on relational-table: close-table | + Subsequent operations to this table will signal an error. + File: slib.info, Node: Database Interpolation, Next: Embedded Commands, Prev: Table Operations, Up: Relational Database - | -Database Interpolation | ----------------------- -`(require 'database-interpolate)' | +6.1.3 Database Interpolation | +---------------------------- | + +`(require 'database-interpolate)' -Indexed sequential access methods allow finding the keys (having | -associations) closest to a given value. This facilitates the | -interpolation of associations between those in the table. | +Indexed sequential access methods allow finding the keys (having +associations) closest to a given value. This facilitates the +interpolation of associations between those in the table. - - Function: interpolate-from-table table column | - TABLE should be a relational table with one numeric primary key | - field which supports the `isam-prev' and `isam-next' operations. | - COLUMN should be a symbol or exact positive integer designating a | - numerically valued column of TABLE. | + -- Function: interpolate-from-table table column | + TABLE should be a relational table with one numeric primary key + field which supports the `isam-prev' and `isam-next' operations. + COLUMN should be a symbol or exact positive integer designating a + numerically valued column of TABLE. - `interpolate-from-table' calculates and returns a value | - proportionally intermediate between its values in the next and | - previous key records contained in TABLE. For keys larger than all | - the stored keys the value associated with the largest stored key | - is used. For keys smaller than all the stored keys the value | - associated with the smallest stored key is used. | + `interpolate-from-table' calculates and returns a value + proportionally intermediate between its values in the next and + previous key records contained in TABLE. For keys larger than all + the stored keys the value associated with the largest stored key + is used. For keys smaller than all the stored keys the value + associated with the smallest stored key is used. File: slib.info, Node: Embedded Commands, Next: Database Macros, Prev: Database Interpolation, Up: Relational Database - | -Embedded Commands ------------------ + +6.1.4 Embedded Commands | +----------------------- | `(require 'database-commands)' @@ -8786,19 +9463,19 @@ code in the `*commands*' table. File: slib.info, Node: Database Extension, Next: Command Intrinsics, Prev: Embedded Commands, Up: Embedded Commands -Database Extension -.................. +6.1.4.1 Database Extension | +.......................... | - - Function: wrap-command-interface rdb + -- Function: wrap-command-interface rdb | Returns relational database RDB wrapped with additional commands defined in its *commands* table. - - Function: add-command-tables rdb + -- Function: add-command-tables rdb | The relational database RDB must be mutable. ADD-COMMAND-TABLES adds a *command* table to RDB; then returns `(wrap-command-interface RDB)'. - - Function: define-*commands* rdb spec-0 ... + -- Function: define-*commands* rdb spec-0 ... | Adds commands to the `*commands*' table as specified in SPEC-0 ... to the open relational-database RDB. Each SPEC has the form: @@ -8816,8 +9493,8 @@ Database Extension (lambda (<name> <rdb>) <expression1> <expression2> ...) - - Function: open-command-database filename - - Function: open-command-database filename base-table-type + -- Function: open-command-database filename | + -- Function: open-command-database filename base-table-type | Returns an open enhanced 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, @@ -8825,28 +9502,28 @@ Database Extension base-table-type. If the database can not be opened or if it lacks the `*commands*' table, `#f' is returned. - - Function: open-command-database! filename - - Function: open-command-database! filename base-table-type + -- Function: open-command-database! filename | + -- Function: open-command-database! filename base-table-type | Returns _mutable_ open enhanced relational database ... - - Function: open-command-database database + -- Function: open-command-database database | Returns DATABASE if it is an immutable relational database; #f otherwise. - - Function: open-command-database! database + -- Function: open-command-database! database | Returns DATABASE if it is a mutable relational database; #f otherwise. File: slib.info, Node: Command Intrinsics, Next: Define-tables Example, Prev: Database Extension, Up: Embedded Commands -Command Intrinsics -.................. +6.1.4.2 Command Intrinsics | +.......................... | Some commands are defined in all extended relational-databases. The are called just like *Note Database Operations::. - - Operation on relational-database: add-domain domain-row | + -- Operation on relational-database: 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'. @@ -8875,18 +9552,18 @@ called just like *Note Database Operations::. (filename #f #f string #f) (build-whats #f #f symbol #f))) - - Operation on relational-database: delete-domain domain-name | + -- Operation on relational-database: delete-domain domain-name | Removes and returns the DOMAIN-NAME row from the "domains" table. - - Operation on relational-database: domain-checker domain | + -- Operation on relational-database: domain-checker domain | Returns a procedure to check an argument for conformance to domain DOMAIN. File: slib.info, Node: Define-tables Example, Next: The *commands* Table, Prev: Command Intrinsics, Up: Embedded Commands -Define-tables Example -..................... +6.1.4.3 Define-tables Example | +............................. | The following example shows a new database with the name of `foo.db' being created with tables describing processor families and @@ -8901,10 +9578,10 @@ saved and changed to immutable. ((also-ran processor-family)) ((m68000 #f) (m68030 m68000) - (i386 i8086) | - (i8086 #f) | + (i386 i8086) + (i8086 #f) (powerpc #f))) - + '(platform ((name symbol)) ((processor processor-family) @@ -8916,21 +9593,21 @@ saved and changed to immutable. (amiga-sas/c-5.10 m68000 amiga sas/c) (atari-st-gcc m68000 atari gcc) (atari-st-turbo-c m68000 atari turbo-c) - (borland-c-3.1 i8086 ms-dos borland-c) | + (borland-c-3.1 i8086 ms-dos borland-c) (djgpp i386 ms-dos gcc) (linux i386 linux gcc) - (microsoft-c i8086 ms-dos microsoft-c) | + (microsoft-c i8086 ms-dos microsoft-c) (os/2-emx i386 os/2 gcc) - (turbo-c-2 i8086 ms-dos turbo-c) | + (turbo-c-2 i8086 ms-dos turbo-c) (watcom-9.0 i386 ms-dos watcom)))) - + (solidify-database my-rdb) File: slib.info, Node: The *commands* Table, Next: Command Service, Prev: Define-tables Example, Up: Embedded Commands -The *commands* Table -.................... +6.1.4.4 The *commands* Table | +............................ | The table `*commands*' in an "enhanced" relational-database has the fields (with domains): @@ -8947,7 +9624,7 @@ The intent of this table is to be of a form such that different user-interfaces (for instance, pull-down menus or plain-text queries) can operate from the same table. A `parameter-list' table has the following fields: - PRI index ordinal | + PRI index ordinal name symbol arity parameter-arity domain domain @@ -8991,10 +9668,10 @@ shared state with the domain-integrity-rule. File: slib.info, Node: Command Service, Next: Command Example, Prev: The *commands* Table, Up: Embedded Commands -Command Service -............... +6.1.4.5 Command Service | +....................... | - - 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 @@ -9044,8 +9721,8 @@ For information about parameters, *Note Parameter lists::. File: slib.info, Node: Command Example, Prev: Command Service, Up: Embedded Commands -Command Example -............... +6.1.4.6 Command Example | +....................... | Here is an example of setting up a command with arguments and parsing those arguments from a `getopt' style argument list (*note Getopt::). @@ -9057,9 +9734,9 @@ those arguments from a `getopt' style argument list (*note Getopt::). (require 'getopt) (require 'fluid-let) (require 'printf) - + (define my-rdb (add-command-tables (create-database #f 'alist-table))) - + (define-tables my-rdb '(foo-params *parameter-columns* @@ -9070,13 +9747,13 @@ those arguments from a `getopt' style argument list (*note Getopt::). (lambda (pl) '()) #f "zero or more symbols") (3 nary1-symbols nary1 symbol (lambda (pl) '(symb)) #f "one or more symbols") - (4 optional-number optional ordinal | + (4 optional-number optional ordinal (lambda (pl) '()) #f "zero or one number") (5 flag boolean boolean (lambda (pl) '(#f)) #f "a boolean flag"))) '(foo-pnames ((name string)) - ((parameter-index ordinal)) | + ((parameter-index ordinal)) (("s" 1) ("single-string" 1) ("n" 2) @@ -9098,7 +9775,7 @@ those arguments from a `getopt' style argument list (*note Getopt::). foo-pnames (lambda (rdb) (lambda args (print args))) "test command arguments")))) - + (define (dbutil:serve-command-line rdb command-table command argv) (set! *argv* (if (vector? argv) (vector->list argv) argv)) ((make-command-server rdb command-table) @@ -9107,7 +9784,7 @@ those arguments from a `getopt' style argument list (*note Getopt::). arities types defaulters dirs aliases) (apply comval (getopt->arglist options positions arities types defaulters dirs aliases))))) - + (define (cmd . opts) (fluid-let ((*optind* 1)) (printf "%-34s => " @@ -9117,7 +9794,7 @@ those arguments from a `getopt' style argument list (*note Getopt::). (force-output) (dbutil:serve-command-line my-rdb 'my-commands 'foo (length opts) opts))) - + (cmd) => ("str" () (symb) () #f) (cmd "-f") => ("str" () (symb) () #t) (cmd "--flag") => ("str" () (symb) () #t) @@ -9144,20 +9821,20 @@ those arguments from a `getopt' style argument list (*note Getopt::). (cmd "-?") -| Usage: cmd [OPTION ARGUMENT ...] ... - + -f, --flag -o, --optional[=]<number> -n, --nary[=]<symbols> ... -N, --nary1[=]<symbols> ... -s, --single[=]<string> - + ERROR: getopt->parameter-list "unrecognized option" "-?" File: slib.info, Node: Database Macros, Next: Database Browser, Prev: Embedded Commands, Up: Relational Database - | -Database Macros ---------------- + +6.1.5 Database Macros | +--------------------- | `(require 'within-database)' @@ -9178,27 +9855,36 @@ emacs: * Menu: +* Within-database:: | * Within-database Example:: - - Function: within-database database statement-1 ... + +File: slib.info, Node: Within-database, Next: Within-database Example, Prev: Database Macros, Up: Database Macros + | +6.1.5.1 Within-database | +....................... | + | + -- Function: within-database database statement-1 ... | `within-database' creates a lexical scope in which the commands `define-table' and `define-command' create tables and `*commands*'-table entries respectively in open relational - database DATABASE. + database DATABASE. The expressions in `within-database' form are | + executed in order. | `within-database' Returns DATABASE. - - Syntax: define-command (<name> <rdb>) "comment" <expression1> + -- Syntax: define-command (<name> <rdb>) "comment" <expression1> | <expression2> ... - - Syntax: define-command (<name> <rdb>) <expression1> <expression2> ... + -- Syntax: define-command (<name> <rdb>) <expression1> <expression2> | + ... | Adds to the `*commands*' table a command <name>: (lambda (<name> <rdb>) <expression1> <expression2> ...) - - Syntax: define-table <name> <descriptor-name> <descriptor-name> + -- Syntax: define-table <name> <descriptor-name> <descriptor-name> | <rows> - - Syntax: define-table <name> <primary-key-fields> <other-fields> + -- Syntax: define-table <name> <primary-key-fields> <other-fields> | <rows> where <name> is the table name, <descriptor-name> is the symbol name of a descriptor table, <primary-key-fields> and @@ -9220,23 +9906,50 @@ emacs: If <domain> is not a defined domain name and it matches the name of this table or an already defined (in one of SPEC-0 ...) single key - field table, a foreign-key domain will be created for it. | - - + field table, a foreign-key domain will be created for it. + + + -- Function: add-macro-support database | + The relational database DATABASE must be mutable. | + `add-macro-support' adds a `*macros*' table and `define-macro' | + macro to DATABASE; then DATABASE is returned. | + | + -- Syntax: define-macro (<name> arg1 ...) "comment" <expression1> | + <expression2> ... | + -- Syntax: define-macro (<name> arg1 ...) <expression1> <expression2> | + ... | + Adds a macro <name> to the `*macros*'. | + | + _Note:_ `within-database' creates lexical scope where not only | + `define-command' and `define-table', but every command and macro | + are defined, ie.: | + | + (within-database my-rdb | + (define-command (message rdb) | + (lambda (msg) | + (display "message: ") | + (display msg) | + (newline))) | + (message "Defining FOO...") | + ;; ... defining FOO ... | + (message "Defining BAR...") | + ;; ... defining BAR ... | + ) | + | -File: slib.info, Node: Within-database Example, Prev: Database Macros, Up: Database Macros - -Within-database Example -....................... +File: slib.info, Node: Within-database Example, Prev: Within-database, Up: Database Macros + | +6.1.5.2 Within-database Example | +............................... | Here is an example of `within-database' macros: (require 'within-database) - + (define my-rdb (add-command-tables (create-database "foo.db" 'alist-table))) - + (within-database my-rdb (define-command (*initialize* rdb) "Print Welcome" @@ -9251,8 +9964,8 @@ Here is an example of `within-database' macros: ((also-ran processor-family))) (m68000 #f) (m68030 m68000) - (i386 i8086) | - (i8086 #f) | + (i386 i8086) + (i8086 #f) (powerpc #f)) (define-table (platform ((name symbol)) @@ -9269,627 +9982,627 @@ Here is an example of `within-database' macros: (define-command (get-processor rdb) "Get processor for given platform." (((rdb 'open-table) 'platform #f) 'get 'processor))) - + (close-database my-rdb) - + (set! my-rdb (open-command-database! "foo.db")) -| Welcome - + (my-rdb 'without-documentation) -| without-documentation called - + ((my-rdb 'get-processor) 'amiga-sas/c-5.10) => m68000 - + (close-database my-rdb) File: slib.info, Node: Database Browser, Prev: Database Macros, Up: Relational Database - | -Database Browser | ----------------- -(require 'database-browse) | +6.1.6 Database Browser | +---------------------- | - - Procedure: browse database | - Prints the names of all the tables in DATABASE and sets browse's | - default to DATABASE. | +(require 'database-browse) - - Procedure: browse | - Prints the names of all the tables in the default database. | + -- Procedure: browse database | + Prints the names of all the tables in DATABASE and sets browse's + default to DATABASE. - - 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 | + Prints the names of all the tables in the default database. - - 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 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 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 | + 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 | + Sets browse's default to DATABASE and prints the records of the + table named by the symbol 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. - - 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. | - | File: slib.info, Node: Relational Infrastructure, Next: Weight-Balanced Trees, Prev: Relational Database, Up: Database Packages - | -Relational Infrastructure | -========================= | -* Menu: | +6.2 Relational Infrastructure | +============================= | + +* Menu: -* Base Table:: | -* Catalog Representation:: | -* Relational Database Objects:: | -* Database Operations:: | +* Base Table:: +* Catalog Representation:: +* Relational Database Objects:: +* Database Operations:: File: slib.info, Node: Base Table, Next: Catalog Representation, Prev: Relational Infrastructure, Up: Relational Infrastructure - | -Base Table | ----------- | -A "base-table" is the primitive database layer upon which SLIB | -relational databases are built. At the minimum, it must support the | -types integer, symbol, string, and boolean. The base-table may restrict | -the size of integers, symbols, and strings it supports. | +6.2.1 Base Table | +---------------- | - A base table implementation is available as the value of the | -identifier naming it (eg. ALIST-TABLE) after requiring the symbol of | -that name. | +A "base-table" is the primitive database layer upon which SLIB +relational databases are built. At the minimum, it must support the +types integer, symbol, string, and boolean. The base-table may restrict +the size of integers, symbols, and strings it supports. - - Feature: alist-table | - `(require 'alist-table)' | + A base table implementation is available as the value of the +identifier naming it (eg. ALIST-TABLE) after requiring the symbol of +that name. - Association-list base tables support all Scheme types and are | - suitable for small databases. In order to be retrieved after | - being written to a file, the data stored should include only | - objects which are readable and writeable in the Scheme | - implementation. | + -- Feature: alist-table | + `(require 'alist-table)' - The "alist-table" base-table implementation is included in the | - SLIB distribution. | + Association-list base tables support all Scheme types and are + suitable for small databases. In order to be retrieved after + being written to a file, the data stored should include only + objects which are readable and writeable in the Scheme + implementation. - "WB" is a B-tree database package with SCM interfaces. Being | -disk-based, WB databases readily store and access hundreds of megabytes | -of data. WB comes with two base-table embeddings. | - | - - Feature: wb-table | - `(require 'wb-table)' | - | - `wb-table' supports scheme expressions for keys and values whose | - text representations are less than 255 characters in length. | - *Note wb-table: (wb)wb-table. | - | - - Feature: rwb-isam | - `(require 'rwb-isam)' | - | - "rwb-isam" is a sophisticated base-table implementation built on | - WB and SCM which uses binary numerical formats for key and non-key | - fields. It supports IEEE floating-point and fixed-precision | - integer keys with the correct numerical collation order. | - | - This rest of this section documents the interface for a base table | -implementation from which the *Note Relational Database:: package | -constructs a Relational system. It will be of interest primarily to | -those wishing to port or write new base-table implementations. | - | - - Variable: *base-table-implementations* | - To support automatic dispatch for `open-database', each base-table | - module adds an association to *BASE-TABLE-IMPLEMENTATIONS* when | - loaded. This association is the list of the base-table symbol and | - the value returned by `(make-relational-system BASE-TABLE)'. | - | -* Menu: | - | -* The Base:: | -* Base Tables:: | -* Base Field Types:: | -* Composite Keys:: | -* Base Record Operations:: | -* Match Keys:: | -* Aggregate Base Operations:: | -* Base ISAM Operations:: | + The "alist-table" base-table implementation is included in the + SLIB distribution. + + "WB" is a B-tree database package with SCM interfaces. Being +disk-based, WB databases readily store and access hundreds of megabytes +of data. WB comes with two base-table embeddings. + + -- Feature: wb-table | + `(require 'wb-table)' + + `wb-table' supports scheme expressions for keys and values whose + text representations are less than 255 characters in length. + *Note wb-table: (wb)wb-table. + + -- Feature: rwb-isam | + `(require 'rwb-isam)' + + "rwb-isam" is a sophisticated base-table implementation built on + WB and SCM which uses binary numerical formats for key and non-key + fields. It supports IEEE floating-point and fixed-precision + integer keys with the correct numerical collation order. + + This rest of this section documents the interface for a base table +implementation from which the *Note Relational Database:: package +constructs a Relational system. It will be of interest primarily to +those wishing to port or write new base-table implementations. + + -- Variable: *base-table-implementations* | + To support automatic dispatch for `open-database', each base-table + module adds an association to *BASE-TABLE-IMPLEMENTATIONS* when + loaded. This association is the list of the base-table symbol and + the value returned by `(make-relational-system BASE-TABLE)'. + +* Menu: + +* The Base:: +* Base Tables:: +* Base Field Types:: +* Composite Keys:: +* Base Record Operations:: +* Match Keys:: +* Aggregate Base Operations:: +* Base ISAM Operations:: File: slib.info, Node: The Base, Next: Base Tables, Prev: Base Table, Up: Base Table - | -The Base | -........ | - -All of these functions are accessed through a single procedure by | -calling that procedure with the symbol name of the operation. A | -procedure will be returned if that operation is supported and `#f' | -otherwise. For example: | - - (require 'alist-table) | - (define my-base (alist-table 'make-base)) | - my-base => *a procedure* | - (define foo (alist-table 'foo)) | - foo => #f | - - - Operation on base-table: 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 | - KEY-DIMENSION is the number of keys composed to make a PRIMARY-KEY | - for the catalog table. The list of symbols COLUMN-TYPES describes | - the types of each column for that table. If the database cannot | - be created as specified, `#f' is returned. | - - Calling the `close-base' method on this database and possibly other | - operations will cause FILENAME to be written to. If FILENAME is | - `#f' a temporary, non-disk based database will be created if such | - can be supported by the base table implelentation. | - - - Operation on base-table: 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 | - methods for inquiring the database will be available. If the | - database cannot be opened as specified `#f' is returned. | - - Calling the `close-base' (and possibly other) method on a MUTABLE | - database will cause FILENAME to be written to. | - - - Operation on base-table: 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 | - possibly other) method on LLDB may cause FILENAME to be written | - to. If FILENAME is `#f' this database will be changed to a | - temporary, non-disk based database if such can be supported by the | - underlying base table implelentation. If the operations completed | - successfully, `#t' is returned. Otherwise, `#f' is returned. | - - - Operation on base-table: 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. | - | - - Operation on base-table: 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. | + +6.2.1.1 The Base | +................ | + +All of these functions are accessed through a single procedure by +calling that procedure with the symbol name of the operation. A +procedure will be returned if that operation is supported and `#f' +otherwise. For example: + + (require 'alist-table) + (define my-base (alist-table 'make-base)) + my-base => *a procedure* + (define foo (alist-table 'foo)) + foo => #f + + -- Operation on base-table: 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 + KEY-DIMENSION is the number of keys composed to make a PRIMARY-KEY + for the catalog table. The list of symbols COLUMN-TYPES describes + the types of each column for that table. If the database cannot + be created as specified, `#f' is returned. + + Calling the `close-base' method on this database and possibly other + operations will cause FILENAME to be written to. If FILENAME is + `#f' a temporary, non-disk based database will be created if such + can be supported by the base table implelentation. + + -- Operation on base-table: 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 + methods for inquiring the database will be available. If the + database cannot be opened as specified `#f' is returned. + + Calling the `close-base' (and possibly other) method on a MUTABLE + database will cause FILENAME to be written to. + + -- Operation on base-table: 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 + possibly other) method on LLDB may cause FILENAME to be written + to. If FILENAME is `#f' this database will be changed to a + temporary, non-disk based database if such can be supported by the + underlying base table implelentation. If the operations completed + successfully, `#t' is returned. Otherwise, `#f' is returned. + + -- Operation on base-table: 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. + + -- Operation on base-table: 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. File: slib.info, Node: Base Tables, Next: Base Field Types, Prev: The Base, Up: Base Table - | -Base Tables | -........... | - | - - Operation on base-table: make-table lldb key-dimension column-types | - Returns the ordinal 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 keys composed to make a PRIMARY-KEY for this | - table. The list of symbols COLUMN-TYPES describes the types of | - each column. | - | - - Operation on base-table: 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'. | - | - As with `make-table', the positive integer KEY-DIMENSION is the | - number of keys composed to make a PRIMARY-KEY for this table. The | - list of symbols COLUMN-TYPES describes the types of each column. | - | - - Operation on base-table: 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. | - | - - Operation on base-table: catalog-id | - A constant BASE-ID ordinal suitable for passing as a parameter to | - `open-table'. CATALOG-ID will be used as the base table for the | - system catalog. | - | + +6.2.1.2 Base Tables | +................... | + + -- Operation on base-table: make-table lldb key-dimension column-types | + Returns the ordinal 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 keys composed to make a PRIMARY-KEY for this + table. The list of symbols COLUMN-TYPES describes the types of + each column. + + -- Operation on base-table: 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'. + + As with `make-table', the positive integer KEY-DIMENSION is the + number of keys composed to make a PRIMARY-KEY for this table. The + list of symbols COLUMN-TYPES describes the types of each column. + + -- Operation on base-table: 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. + + -- Operation on base-table: catalog-id | + A constant BASE-ID ordinal suitable for passing as a parameter to + `open-table'. CATALOG-ID will be used as the base table for the + system catalog. + File: slib.info, Node: Base Field Types, Next: Composite Keys, Prev: Base Tables, Up: Base Table - | -Base Field Types | -................ | - | - - Operation on base-table: 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', `ordinal', | - `symbol', `string', and `boolean'. | - | - - Operation on base-table: 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 `ordinal', and `symbol'. | - | -An "ordinal" is an exact positive integer. The other types are | -standard Scheme. | - | + +6.2.1.3 Base Field Types | +........................ | + + -- Operation on base-table: 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', `ordinal', + `symbol', `string', and `boolean'. + + -- Operation on base-table: 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 `ordinal', and `symbol'. + +An "ordinal" is an exact positive integer. The other types are +standard Scheme. + File: slib.info, Node: Composite Keys, Next: Base Record Operations, Prev: Base Field Types, Up: Base Table - | -Composite Keys | -.............. | - | - - Operation on base-table: 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 | - follow. | - | - Any 2 arguments of the supported type passed to the returned | - function which are not `equal?' must result in returned values | - which are not `equal?'. | - | - - Operation on base-table: 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 | - by TYPES. This returned procedure combines the elements of its | - list argument into an object suitable for being a KEY argument in | - the functions whose descriptions follow. | - | - Any 2 lists of supported types (which must at least include | - symbols and non-negative integers) passed to the returned function | - which are not `equal?' must result in returned values which are not | - `equal?'. | - | - - Operation on base-table: 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 COMPOSITE-KEY. The | - list TYPES must have at least KEY-DIMENSION elements. | - | - - Operation on base-table: 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 COMPOSITE-KEY. | - | + +6.2.1.4 Composite Keys | +...................... | + + -- Operation on base-table: 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 + follow. + + Any 2 arguments of the supported type passed to the returned + function which are not `equal?' must result in returned values + which are not `equal?'. + + -- Operation on base-table: 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 + by TYPES. This returned procedure combines the elements of its + list argument into an object suitable for being a KEY argument in + the functions whose descriptions follow. + + Any 2 lists of supported types (which must at least include + symbols and non-negative integers) passed to the returned function + which are not `equal?' must result in returned values which are not + `equal?'. + + -- Operation on base-table: 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 COMPOSITE-KEY. The + list TYPES must have at least KEY-DIMENSION elements. + + -- Operation on base-table: 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 COMPOSITE-KEY. + File: slib.info, Node: Base Record Operations, Next: Match Keys, Prev: Composite Keys, Up: Base Table - | -Base Record Operations | -...................... | - | -In the following functions, the KEY argument can always be assumed to | -be the value returned by a call to a _keyify_ routine. | - | - - Operation on base-table: 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. | - | - - Operation on base-table: 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. | - | -`make-getter-1' is a new operation. The relational-database module | -works with older base-table implementations by using `make-getter'. | - | - - Operation on base-table: make-getter-1 key-dimension types index | - Returns a procedure which takes arguments HANDLE and KEY. This | - procedure returns the value of the INDEXth field (in the base | - table opened in HANDLE) whose primary key is KEY if it exists, and | - `#f' otherwise. | - | - INDEX must be larger than KEY-DIMENSION. | - | - - Operation on base-table: 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. | - | - - Operation on base-table: delete handle key | - Removes the row associated with KEY from the table opened in | - HANDLE. An unspecified value is returned. | - | + +6.2.1.5 Base Record Operations | +.............................. | + +In the following functions, the KEY argument can always be assumed to +be the value returned by a call to a _keyify_ routine. + + -- Operation on base-table: 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. + + -- Operation on base-table: 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. + +`make-getter-1' is a new operation. The relational-database module +works with older base-table implementations by using `make-getter'. + + -- Operation on base-table: make-getter-1 key-dimension types index | + Returns a procedure which takes arguments HANDLE and KEY. This + procedure returns the value of the INDEXth field (in the base + table opened in HANDLE) whose primary key is KEY if it exists, and + `#f' otherwise. + + INDEX must be larger than KEY-DIMENSION. + + -- Operation on base-table: 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. + + -- Operation on base-table: delete handle key | + Removes the row associated with KEY from the table opened in + HANDLE. An unspecified value is returned. + File: slib.info, Node: Match Keys, Next: Aggregate Base Operations, Prev: Base Record Operations, Up: Base Table - | -Match Keys | -.......... | - | -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-KEYS list. The elements and their actions are: | - | - `#f' | - The false value matches any key in the corresponding position. | - | - an object of type procedure | - This procedure must take a single argument, the key in the | - corresponding position. Any key for which the procedure | - returns a non-false value is a match; Any key for which the | - procedure returns a `#f' is not. | - | - other values | - Any other value matches only those keys `equal?' to it. | - | + +6.2.1.6 Match Keys | +.................. | + +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-KEYS list. The elements and their actions are: + + `#f' + The false value matches any key in the corresponding position. + + an object of type procedure + This procedure must take a single argument, the key in the + corresponding position. Any key for which the procedure + returns a non-false value is a match; Any key for which the + procedure returns a `#f' is not. + + other values + Any other value matches only those keys `equal?' to it. + File: slib.info, Node: Aggregate Base Operations, Next: Base ISAM Operations, Prev: Match Keys, Up: Base Table - | -Aggregate Base Operations | -......................... | - | -The KEY-DIMENSION and COLUMN-TYPES arguments are needed to decode the | -composite-keys for matching with MATCH-KEYS. | - | - - Operation on base-table: 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. | - | - - Operation on base-table: for-each-key handle procedure key-dimension | - column-types match-keys | - Calls PROCEDURE once with each KEY in the table opened in HANDLE | - which satisfy MATCH-KEYS in an unspecified order. An unspecified | - value is returned. | - | - - Operation on base-table: 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 satisfy | - MATCH-KEYS in an unspecified order. | - | + +6.2.1.7 Aggregate Base Operations | +................................. | + +The KEY-DIMENSION and COLUMN-TYPES arguments are needed to decode the +composite-keys for matching with MATCH-KEYS. + + -- Operation on base-table: 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. + + -- Operation on base-table: for-each-key handle procedure | + key-dimension column-types match-keys | + Calls PROCEDURE once with each KEY in the table opened in HANDLE + which satisfy MATCH-KEYS in an unspecified order. An unspecified + value is returned. + + -- Operation on base-table: 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 satisfy + MATCH-KEYS in an unspecified order. + File: slib.info, Node: Base ISAM Operations, Prev: Aggregate Base Operations, Up: Base Table - | -Base ISAM Operations | -.................... | - | -These operations are optional for a Base-Table implementation. | - | - - Operation on base-table: 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 satisfy MATCH-KEYS in the natural order for the types of the | - primary key fields of that table. An unspecified value is | - returned. | - | - - Operation on base-table: make-nexter handle key-dimension | - column-types index | - Returns a procedure of arguments KEY1 KEY2 ... which returns the | - key-list identifying the lowest record higher than KEY1 KEY2 ... | - which is stored in the base-table and which differs in column | - INDEX or a lower indexed key; or false if no higher record is | - present. | - | - - Operation on base-table: make-prever handle key-dimension | - column-types index | - Returns a procedure of arguments KEY1 KEY2 ... which returns the | - key-list identifying the highest record less than KEY1 KEY2 ... | - which is stored in the base-table and which differs in column | - INDEX or a lower indexed key; or false if no higher record is | - present. | - | + +6.2.1.8 Base ISAM Operations | +............................ | + +These operations are optional for a Base-Table implementation. + + -- Operation on base-table: 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 satisfy MATCH-KEYS in the natural order for the types of the + primary key fields of that table. An unspecified value is + returned. + + -- Operation on base-table: make-nexter handle key-dimension | + column-types index + Returns a procedure of arguments KEY1 KEY2 ... which returns the + key-list identifying the lowest record higher than KEY1 KEY2 ... + which is stored in the base-table and which differs in column + INDEX or a lower indexed key; or false if no higher record is + present. + + -- Operation on base-table: make-prever handle key-dimension | + column-types index + Returns a procedure of arguments KEY1 KEY2 ... which returns the + key-list identifying the highest record less than KEY1 KEY2 ... + which is stored in the base-table and which differs in column + INDEX or a lower indexed key; or false if no higher record is + present. + File: slib.info, Node: Catalog Representation, Next: Relational Database Objects, Prev: Base Table, Up: Relational Infrastructure - | -Catalog Representation | ----------------------- | - | -Each database (in an implementation) has a "system catalog" which | -describes all the user accessible tables in that database (including | -itself). | - | -The system catalog base table has the following fields. `PRI' | -indicates a primary key for that table. | - | - PRI table-name | - column-limit the highest column number | - coltab-name descriptor table name | - bastab-id data base table identifier | - user-integrity-rule | - view-procedure A scheme thunk which, when called, | - produces a handle for the view. coltab | - and bastab are specified if and only if | - view-procedure is not. | - | -Descriptors for base tables (not views) are tables (pointed to by | -system catalog). Descriptor (base) tables have the fields: | - | - PRI column-number sequential integers from 1 | - primary-key? boolean TRUE for primary key components | - column-name | - column-integrity-rule | - domain-name | - | -A "primary key" is any column marked as `primary-key?' in the | -corresponding descriptor table. All the `primary-key?' columns must | -have lower column numbers than any non-`primary-key?' columns. Every | -table must have at least one primary key. Primary keys must be | -sufficient to distinguish all rows from each other in the table. All of | -the system defined tables have a single primary key. | - | -A "domain" is a category describing the allowable values to occur in a | -column. It is described by a (base) table with the fields: | - | - PRI domain-name | - foreign-table | - domain-integrity-rule | - type-id | - type-param | - | -The "type-id" field value is a symbol. This symbol may be used by the | -underlying base table implementation in storing that field. | - | -If the `foreign-table' field is non-`#f' then that field names a table | -from the catalog. The values for that domain must match a primary key | -of the table referenced by the TYPE-PARAM (or `#f', if allowed). This | -package currently does not support composite foreign-keys. | - | -The types for which support is planned are: | - atom | - symbol | - string [<length>] | - number [<base>] | - money <currency> | - date-time | - boolean | - | - foreign-key <table-name> | - expression | - virtual <expression> | - | + +6.2.2 Catalog Representation | +---------------------------- | + +Each database (in an implementation) has a "system catalog" which +describes all the user accessible tables in that database (including +itself). + +The system catalog base table has the following fields. `PRI' +indicates a primary key for that table. + + PRI table-name + column-limit the highest column number + coltab-name descriptor table name + bastab-id data base table identifier + user-integrity-rule + view-procedure A scheme thunk which, when called, + produces a handle for the view. coltab + and bastab are specified if and only if + view-procedure is not. + +Descriptors for base tables (not views) are tables (pointed to by +system catalog). Descriptor (base) tables have the fields: + + PRI column-number sequential integers from 1 + primary-key? boolean TRUE for primary key components + column-name + column-integrity-rule + domain-name + +A "primary key" is any column marked as `primary-key?' in the +corresponding descriptor table. All the `primary-key?' columns must +have lower column numbers than any non-`primary-key?' columns. Every +table must have at least one primary key. Primary keys must be +sufficient to distinguish all rows from each other in the table. All of +the system defined tables have a single primary key. + +A "domain" is a category describing the allowable values to occur in a +column. It is described by a (base) table with the fields: + + PRI domain-name + foreign-table + domain-integrity-rule + type-id + type-param + +The "type-id" field value is a symbol. This symbol may be used by the +underlying base table implementation in storing that field. + +If the `foreign-table' field is non-`#f' then that field names a table +from the catalog. The values for that domain must match a primary key +of the table referenced by the TYPE-PARAM (or `#f', if allowed). This +package currently does not support composite foreign-keys. + +The types for which support is planned are: + atom + symbol + string [<length>] + number [<base>] + money <currency> + date-time + boolean + + foreign-key <table-name> + expression + virtual <expression> + File: slib.info, Node: Relational Database Objects, Next: Database Operations, Prev: Catalog Representation, Up: Relational Infrastructure - | -Relational Database Objects | ---------------------------- | - | -This object-oriented interface is deprecated for typical database | -applications; *Note Using Databases:: provides an application programmer | -interface which is easier to understand and use. | - | - - Function: make-relational-system base-table-implementation | - Returns a procedure implementing a relational database using the | - BASE-TABLE-IMPLEMENTATION. | - | - All of the operations of a base table implementation are accessed | - through a procedure defined by `require'ing that implementation. | - Similarly, all of the operations of the relational database | - implementation are accessed through the procedure returned by | - `make-relational-system'. For instance, a new relational database | - could be created from the procedure returned by | - `make-relational-system' by: | - | - (require 'alist-table) | - (define relational-alist-system | - (make-relational-system alist-table)) | - (define create-alist-database | - (relational-alist-system 'create-database)) | - (define my-database | - (create-alist-database "mydata.db")) | - | -What follows are the descriptions of the methods available from | -relational system returned by a call to `make-relational-system'. | - | - - Operation on relational-system: 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 | - and possibly other operations will cause FILENAME to be written | - to. If FILENAME is `#f' a temporary, non-disk based database will | - be created if such can be supported by the underlying base table | - implelentation. If the database cannot be created as specified | - `#f' is returned. For the fields and layout of descriptor tables, | - *Note Catalog Representation:: | - | - - Operation on relational-system: 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 | - methods for inquiring the database will be available. Calling the | - `close-database' (and possibly other) method on a MUTABLE? | - database will cause FILENAME to be written to. If the database | - cannot be opened as specified `#f' is returned. | - | + +6.2.3 Relational Database Objects | +--------------------------------- | + +This object-oriented interface is deprecated for typical database +applications; *Note Using Databases:: provides an application programmer +interface which is easier to understand and use. + + -- Function: make-relational-system base-table-implementation | + Returns a procedure implementing a relational database using the + BASE-TABLE-IMPLEMENTATION. + + All of the operations of a base table implementation are accessed + through a procedure defined by `require'ing that implementation. + Similarly, all of the operations of the relational database + implementation are accessed through the procedure returned by + `make-relational-system'. For instance, a new relational database + could be created from the procedure returned by + `make-relational-system' by: + + (require 'alist-table) + (define relational-alist-system + (make-relational-system alist-table)) + (define create-alist-database + (relational-alist-system 'create-database)) + (define my-database + (create-alist-database "mydata.db")) + +What follows are the descriptions of the methods available from +relational system returned by a call to `make-relational-system'. + + -- Operation on relational-system: 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 + and possibly other operations will cause FILENAME to be written + to. If FILENAME is `#f' a temporary, non-disk based database will + be created if such can be supported by the underlying base table + implelentation. If the database cannot be created as specified + `#f' is returned. For the fields and layout of descriptor tables, + *Note Catalog Representation:: + + -- Operation on relational-system: 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 + methods for inquiring the database will be available. Calling the + `close-database' (and possibly other) method on a MUTABLE? + database will cause FILENAME to be written to. If the database + cannot be opened as specified `#f' is returned. + File: slib.info, Node: Database Operations, Prev: Relational Database Objects, Up: Relational Infrastructure - | -Database Operations | -------------------- | - | -This object-oriented interface is deprecated for typical database | -applications; *Note Using Databases:: provides an application programmer | -interface which is easier to understand and use. | - | -These are the descriptions of the methods available from an open | -relational database. A method is retrieved from a database by calling | -the database with the symbol name of the operation. For example: | - | - (define my-database | - (create-alist-database "mydata.db")) | - (define telephone-table-desc | - ((my-database 'create-table) 'telephone-table-desc)) | - | - - Operation on relational-database: close-database | - Causes the relational database to be written to its associated | - file (if any). If the write is successful, subsequent operations | - to this database will signal an error. If the operations completed | - successfully, `#t' is returned. Otherwise, `#f' is returned. | - | - - Operation on relational-database: 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 | - possibly other) method on this database will cause FILENAME to be | - written to. If FILENAME is `#f' this database will be changed to | - a temporary, non-disk based database if such can be supported by | - the underlying base table implelentation. If the operations | - completed successfully, `#t' is returned. Otherwise, `#f' is | - returned. | - | - - Operation on relational-database: 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. | - | - - Operation on relational-database: solidify-database | - Causes any pending updates to the database file to be written out. | - If the writes completed successfully, then the database is | - changed to be immutable and `#t' is returned. Otherwise, `#f' is | - returned. | - | - - Operation on relational-database: table-exists? table-name | - Returns `#t' if TABLE-NAME exists in the system catalog, otherwise | - returns `#f'. | - | - - Operation on relational-database: 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 mutable databases. | - | - - Operation on relational-database: 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. | - | - - Operation on relational-database: 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::. | - | - - Operation on relational-database: 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'. | - | - - Operation on relational-database: create-view ?? | - - Operation on relational-database: project-table ?? | - - Operation on relational-database: restrict-table ?? | - - Operation on relational-database: cart-prod-tables ?? | - Not yet implemented. | - | + +6.2.4 Database Operations | +------------------------- | + +This object-oriented interface is deprecated for typical database +applications; *Note Using Databases:: provides an application programmer +interface which is easier to understand and use. + +These are the descriptions of the methods available from an open +relational database. A method is retrieved from a database by calling +the database with the symbol name of the operation. For example: + + (define my-database + (create-alist-database "mydata.db")) + (define telephone-table-desc + ((my-database 'create-table) 'telephone-table-desc)) + + -- Operation on relational-database: close-database | + Causes the relational database to be written to its associated + file (if any). If the write is successful, subsequent operations + to this database will signal an error. If the operations completed + successfully, `#t' is returned. Otherwise, `#f' is returned. + + -- Operation on relational-database: 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 + possibly other) method on this database will cause FILENAME to be + written to. If FILENAME is `#f' this database will be changed to + a temporary, non-disk based database if such can be supported by + the underlying base table implelentation. If the operations + completed successfully, `#t' is returned. Otherwise, `#f' is + returned. + + -- Operation on relational-database: 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. + + -- Operation on relational-database: solidify-database | + Causes any pending updates to the database file to be written out. + If the writes completed successfully, then the database is + changed to be immutable and `#t' is returned. Otherwise, `#f' is + returned. + + -- Operation on relational-database: table-exists? table-name | + Returns `#t' if TABLE-NAME exists in the system catalog, otherwise + returns `#f'. + + -- Operation on relational-database: 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 mutable databases. + + -- Operation on relational-database: 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. + + -- Operation on relational-database: 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::. + + -- Operation on relational-database: 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'. + + -- Operation on relational-database: create-view ?? | + -- Operation on relational-database: project-table ?? | + -- Operation on relational-database: restrict-table ?? | + -- Operation on relational-database: cart-prod-tables ?? | + Not yet implemented. + File: slib.info, Node: Weight-Balanced Trees, Prev: Relational Infrastructure, Up: Database Packages - | -Weight-Balanced Trees -===================== -`(require 'wt-tree)' +6.3 Weight-Balanced Trees | +========================= | + +`(require 'wt-tree)' Balanced binary trees are a useful data structure for maintaining large sets of ordered objects or sets of associations whose keys are @@ -9956,7 +10669,7 @@ based on interpreting the trees as sets, hence the name To use weight balanced trees, execute (load-option 'wt-tree) - + once before calling any of the procedures defined here. * Menu: @@ -9969,8 +10682,8 @@ once before calling any of the procedures defined here. File: slib.info, Node: Construction of Weight-Balanced Trees, Next: Basic Operations on Weight-Balanced Trees, Prev: Weight-Balanced Trees, Up: Weight-Balanced Trees -Construction of Weight-Balanced Trees -------------------------------------- +6.3.1 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 @@ -9984,7 +10697,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': @@ -10004,33 +10717,33 @@ used many times throughout the program's execution. tree operations must all be created with a tree type originating from the same call to `make-wt-tree-type'. - - variable+: number-wt-type + -- variable+: number-wt-type | A standard tree type for trees with numeric keys. `Number-wt-type' could have been defined by (define number-wt-type (make-wt-tree-type <)) - - variable+: string-wt-type + -- variable+: string-wt-type | A standard tree type for trees with string keys. `String-wt-type' could have been defined by (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: @@ -10046,23 +10759,23 @@ used many times throughout the program's execution. File: slib.info, Node: Basic Operations on Weight-Balanced Trees, Next: Advanced Operations on Weight-Balanced Trees, Prev: Construction of Weight-Balanced Trees, Up: Weight-Balanced Trees -Basic Operations on Weight-Balanced Trees ------------------------------------------ +6.3.2 Basic Operations on Weight-Balanced Trees | +----------------------------------------------- | This section describes the basic tree operations on weight balanced 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/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 @@ -10070,34 +10783,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 @@ -10106,28 +10819,28 @@ number of associations in a tree. File: slib.info, Node: Advanced Operations on Weight-Balanced Trees, Next: Indexing Operations on Weight-Balanced Trees, Prev: Basic Operations on Weight-Balanced Trees, Up: Weight-Balanced Trees -Advanced Operations on Weight-Balanced Trees --------------------------------------------- +6.3.3 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 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 @@ -10140,7 +10853,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 @@ -10151,7 +10864,7 @@ 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 association in WT-TREE-2. If the trees are viewed as sets the @@ -10161,7 +10874,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 @@ -10176,7 +10889,7 @@ 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_. @@ -10193,7 +10906,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 @@ -10214,7 +10927,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 @@ -10230,17 +10943,17 @@ associations. File: slib.info, Node: Indexing Operations on Weight-Balanced Trees, Prev: Advanced Operations on Weight-Balanced Trees, Up: Weight-Balanced Trees -Indexing Operations on Weight-Balanced Trees --------------------------------------------- +6.3.4 Indexing Operations on Weight-Balanced Trees | +-------------------------------------------------- | Weight balanced trees support operations that view the tree as sorted 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' @@ -10258,10 +10971,10 @@ determined, both in logarthmic time. tree as follows: median: (wt-tree/index WT-TREE (quotient (wt-tree/size WT-TREE) 2)) - + 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 @@ -10269,9 +10982,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 @@ -10286,7 +10999,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. @@ -10296,7 +11009,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 @@ -10308,8 +11021,8 @@ determined, both in logarthmic time. File: slib.info, Node: Other Packages, Next: About SLIB, Prev: Database Packages, Up: Top -Other Packages -************** +7 Other Packages | +**************** | * Menu: @@ -10319,13 +11032,13 @@ Other Packages * Standards Support:: Support for Scheme Standards. * Session Support:: REPL and Debugging. * System Interface:: 'system, 'getenv, and other programs. -* Extra-SLIB Packages:: Outside the envelope. | +* Extra-SLIB Packages:: Outside the envelope. File: slib.info, Node: Data Structures, Next: Sorting and Searching, Prev: Other Packages, Up: Other Packages -Data Structures -=============== +7.1 Data Structures | +=================== | * Menu: @@ -10334,7 +11047,7 @@ Data Structures * Array Mapping:: 'array-for-each * Association Lists:: 'alist * Byte:: 'byte -* Byte/Number Conversions:: 'byte-number | +* Byte/Number Conversions:: 'byte-number * MAT-File Format:: 'matfile * Portable Image Files:: 'pnm * Collections:: 'collect @@ -10348,122 +11061,79 @@ Data Structures File: slib.info, Node: Arrays, Next: Subarrays, Prev: Data Structures, Up: Data Structures -Arrays ------- +7.1.1 Arrays | +------------ | -`(require 'array)' +`(require 'array)' or `(require 'srfi-63)' | - - Function: array? obj + -- Function: array? obj | Returns `#t' if the OBJ is an array, and `#f' if not. -_Note:_ Arrays are not disjoint from other Scheme types. Strings and -vectors also satisfy `array?'. A disjoint array predicate can be -written: +_Note:_ Arrays are not disjoint from other Scheme types. Vectors and | +possibly strings 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=? (create-array '#(foo) 3 3) - (create-array '#(foo) '(0 2) '(0 2))) - => #t - - - Function: create-array prototype bound1 bound2 ... - Creates and returns an array of type PROTOTYPE with dimensions - BOUND1, BOUND2, ... and filled with elements from PROTOTYPE. - PROTOTYPE must be an array, vector, or string. The - implementation-dependent type of the returned array will be the - same as the type of PROTOTYPE; except if that would be a vector or - string with non-zero origin, in which case some variety of array - will be returned. - - If the PROTOTYPE has no elements, then the initial contents of the - returned array are unspecified. Otherwise, the returned array - will be filled with the element at the origin of PROTOTYPE. - -These functions return a prototypical uniform-array enclosing the | -optional argument (which must be of the correct type). If the | -uniform-array type is supported by the implementation, then it is | -returned; defaulting to the next larger precision type; resorting | -finally to vector. | - - - Function: ac64 z - - Function: ac64 - Returns a high-precision complex uniform-array prototype. - - - Function: ac32 z - - Function: ac32 - Returns a complex uniform-array prototype. - - - Function: ar64 x - - Function: ar64 - Returns a high-precision real uniform-array prototype. - - - Function: ar32 x - - Function: ar32 - Returns a real uniform-array prototype. - - - Function: as64 n - - Function: as64 - Returns an exact signed integer uniform-array prototype with at - least 64 bits of precision. - - - Function: as32 n - - Function: as32 - Returns an exact signed integer uniform-array prototype with at - least 32 bits of precision. - - - Function: as16 n - - Function: as16 - Returns an exact signed integer uniform-array prototype with at - least 16 bits of precision. - - - Function: as8 n - - Function: as8 - Returns an exact signed integer uniform-array prototype with at - least 8 bits of precision. - - - Function: au64 k - - Function: au64 - Returns an exact non-negative integer uniform-array prototype with - at least 64 bits of precision. - - - Function: au32 k - - Function: au32 - Returns an exact non-negative integer uniform-array prototype with - at least 32 bits of precision. - - - Function: au16 k - - Function: au16 - Returns an exact non-negative integer uniform-array prototype with - at least 16 bits of precision. - - - Function: au8 k - - Function: au8 - Returns an exact non-negative integer uniform-array prototype with - at least 8 bits of precision. - - - Function: at1 bool - - Function: at1 - Returns a boolean uniform-array prototype. - -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 - - (create-array '#(foo) 3 3) == (create-array '#(foo) '(0 2) '(0 2)) - - - Function: make-shared-array array mapper bound1 bound2 ... + -- Function: equal? obj1 obj2 | + Returns `#t' if OBJ1 and OBJ2 have the same rank and dimensions | + and the corresponding elements of OBJ1 and OBJ2 are `equal?'. | + + `equal?' recursively compares the contents of pairs, vectors, | + strings, and _arrays_, applying `eqv?' on other objects such as | + numbers and symbols. A rule of thumb is that objects are | + generally `equal?' if they print the same. `equal?' may fail to | + terminate if its arguments are circular data structures. | + + (equal? 'a 'a) => #t | + (equal? '(a) '(a)) => #t | + (equal? '(a (b) c) | + '(a (b) c)) => #t | + (equal? "abc" "abc") => #t | + (equal? 2 2) => #t | + (equal? (make-vector 5 'a) | + (make-vector 5 'a)) => #t | + (equal? (make-array (A:fixN32b 4) 5 3) | + (make-array (A:fixN32b 4) 5 3)) => #t | + (equal? (make-array '#(foo) 3 3) | + (make-array '#(foo) 3 3)) => #t | + (equal? (lambda (x) x) | + (lambda (y) y)) => _unspecified_ | + + -- Function: array-rank obj | + Returns the number of dimensions of OBJ. If OBJ is not an array, | + 0 is returned. | + + -- Function: array-dimensions array | + Returns a list of dimensions. | + + (array-dimensions (make-array '#() 3 5)) | + => (3 5) | + + -- Function: make-array prototype k1 ... | + Creates and returns an array of type PROTOTYPE with dimensions K1, | + ... and filled with elements from PROTOTYPE. PROTOTYPE must be | + an array, vector, or string. The implementation-dependent type of | + the returned array will be the same as the type of PROTOTYPE; | + except if that would be a vector or string with rank not equal to | + one, in which case some variety of array will be returned. | + + If the PROTOTYPE has no elements, then the initial contents of the | + returned array are unspecified. Otherwise, the returned array | + will be filled with the element at the origin of PROTOTYPE. | + + -- Function: create-array prototype k1 ... | + `create-array' is an alias for `make-array'. | + + -- Function: make-shared-array array mapper k1 ... | `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 (create-array '#(#f) 8 8)) + (define fred (make-array '#(#f) 8 8)) | (define freds-diagonal (make-shared-array fred (lambda (i) (list i i)) 8)) (array-set! freds-diagonal 'foo 3) @@ -10475,42 +11145,167 @@ a single integer. So (array-ref freds-center 0 0) => FOO - - Function: array-rank obj - Returns the number of dimensions of OBJ. If OBJ is not an array, - 0 is returned. + -- Function: list->array rank proto list | + LIST must be a rank-nested list consisting of all the elements, in | + row-major order, of the array to be created. | - - Function: array-shape array - Returns a list of inclusive bounds. + `list->array' returns an array of rank RANK and type PROTO | + consisting of all the elements, in row-major order, of LIST. When | + RANK is 0, LIST is the lone array element; not necessarily a list. | - (array-shape (create-array '#() 3 5)) - => ((0 2) (0 4)) + (list->array 2 '#() '((1 2) (3 4))) | + => #2A((1 2) (3 4)) | + (list->array 0 '#() 3) | + => #0A 3 | - - Function: array-dimensions array - `array-dimensions' is similar to `array-shape' but replaces - elements with a 0 minimum with one greater than the maximum. + -- Function: array->list array | + Returns a rank-nested list consisting of all the elements, in | + row-major order, of ARRAY. In the case of a rank-0 array, | + `array->list' returns the single element. | - (array-dimensions (create-array '#() 3 5)) - => (3 5) + (array->list #2A((ho ho ho) (ho oh oh))) | + => ((ho ho ho) (ho oh oh)) | + (array->list #0A ho) | + => ho | - - Function: array-in-bounds? array index1 index2 ... + -- Function: vector->array vect proto dim1 ... | + VECT must be a vector of length equal to the product of exact | + nonnegative integers DIM1, .... | + | + `vector->array' returns an array of type PROTO consisting of all | + the elements, in row-major order, of VECT. In the case of a | + rank-0 array, VECT has a single element. | + | + (vector->array #(1 2 3 4) #() 2 2) | + => #2A((1 2) (3 4)) | + (vector->array '#(3) '#()) | + => #0A 3 | + | + -- Function: array->vector array | + Returns a new vector consisting of all the elements of ARRAY in | + row-major order. | + | + (array->vector #2A ((1 2)( 3 4))) | + => #(1 2 3 4) | + (array->vector #0A ho) | + => #(ho) | + | + -- Function: array-in-bounds? array index1 ... | Returns `#t' if its arguments would be acceptable to `array-ref'. - - Function: array-ref array index1 index2 ... - Returns the (INDEX1, INDEX2, ...) element of ARRAY. + -- Function: array-ref array k1 ... | + Returns the (K1, ...) element of ARRAY. | - - Procedure: array-set! array obj index1 index2 ... | - Stores OBJ in the (INDEX1, INDEX2, ...) element of ARRAY. The - value returned by `array-set!' is unspecified. + -- Procedure: array-set! array obj k1 ... | + Stores OBJ in the (K1, ...) element of ARRAY. The value returned | + by `array-set!' is unspecified. | + | +These functions return a prototypical uniform-array enclosing the | +optional argument (which must be of the correct type). If the | +uniform-array type is supported by the implementation, then it is | +returned; defaulting to the next larger precision type; resorting | +finally to vector. | + | + -- Function: a:floc128b z | + -- Function: a:floc128b | + Returns an inexact 128.bit flonum complex uniform-array prototype. | + | + -- Function: a:floc64b z | + -- Function: a:floc64b | + Returns an inexact 64.bit flonum complex uniform-array prototype. | + | + -- Function: a:floc32b z | + -- Function: a:floc32b | + Returns an inexact 32.bit flonum complex uniform-array prototype. | + | + -- Function: a:floc16b z | + -- Function: a:floc16b | + Returns an inexact 16.bit flonum complex uniform-array prototype. | + | + -- Function: a:flor128b z | + -- Function: a:flor128b | + Returns an inexact 128.bit flonum real uniform-array prototype. | + | + -- Function: a:flor64b z | + -- Function: a:flor64b | + Returns an inexact 64.bit flonum real uniform-array prototype. | + | + -- Function: a:flor32b z | + -- Function: a:flor32b | + Returns an inexact 32.bit flonum real uniform-array prototype. | + | + -- Function: a:flor16b z | + -- Function: a:flor16b | + Returns an inexact 16.bit flonum real uniform-array prototype. | + | + -- Function: a:flor128b z | + -- Function: a:flor128b | + Returns an exact 128.bit decimal flonum rational uniform-array | + prototype. | + | + -- Function: a:flor64b z | + -- Function: a:flor64b | + Returns an exact 64.bit decimal flonum rational uniform-array | + prototype. | + | + -- Function: a:flor32b z | + -- Function: a:flor32b | + Returns an exact 32.bit decimal flonum rational uniform-array | + prototype. | + | + -- Function: a:fixz64b n | + -- Function: a:fixz64b | + Returns an exact binary fixnum uniform-array prototype with at | + least 64 bits of precision. | + | + -- Function: a:fixz32b n | + -- Function: a:fixz32b | + Returns an exact binary fixnum uniform-array prototype with at | + least 32 bits of precision. | + | + -- Function: a:fixz16b n | + -- Function: a:fixz16b | + Returns an exact binary fixnum uniform-array prototype with at | + least 16 bits of precision. | + | + -- Function: a:fixz8b n | + -- Function: a:fixz8b | + Returns an exact binary fixnum uniform-array prototype with at | + least 8 bits of precision. | + | + -- Function: a:fixn64b k | + -- Function: a:fixn64b | + Returns an exact non-negative binary fixnum uniform-array | + prototype with at least 64 bits of precision. | + | + -- Function: a:fixn32b k | + -- Function: a:fixn32b | + Returns an exact non-negative binary fixnum uniform-array | + prototype with at least 32 bits of precision. | + | + -- Function: a:fixn16b k | + -- Function: a:fixn16b | + Returns an exact non-negative binary fixnum uniform-array | + prototype with at least 16 bits of precision. | + | + -- Function: a:fixn8b k | + -- Function: a:fixn8b | + Returns an exact non-negative binary fixnum uniform-array | + prototype with at least 8 bits of precision. | + | + -- Function: a:bool bool | + -- Function: a:bool | + Returns a boolean uniform-array prototype. | File: slib.info, Node: Subarrays, Next: Array Mapping, Prev: Arrays, Up: Data Structures -Subarrays ---------- +7.1.2 Subarrays | +--------------- | -`(require 'subarray)' +`(require 'subarray)' - - Function: subarray array select ... + -- Function: subarray array select ... | selects a subset of an array. For ARRAY of rank n, there must be at least n SELECTS arguments. For 0 <= j < n, SELECTSj is either an integer, a list of two integers within the range for the jth @@ -10542,26 +11337,10 @@ Subarrays > (subarray ra #f '(1 2)) #2A((b c) (e f)) - - Function: subarray0 array select ... - Behaves like subarray, but aligns the returned array origin to 0 - .... - - - Function: array-align array coord ... - Returns an array shared with ARRAY but with a different origin. - The COORDS are the exact integer coordinates of the new origin. - Indexes corresponding to missing or #f coordinates are not - realigned. + -- Variable: subarray0 | + Legacy alias for subarray. | - For example: - (define ra2 (create-array '#(5) '(5 9) '(-4 0))) - (array-shape ra2) => ((5 9) (-4 0)) - (array-shape (array-align ra2 0 0)) => ((0 4) (0 4)) - (array-shape (array-align ra2 0)) => ((0 4) (-4 0)) - (array-shape (array-align ra2)) => ((5 9) (-4 0)) - (array-shape (array-align ra2 0 #f)) => ((0 4) (-4 0)) - (array-shape (array-align ra2 #f 0)) => ((5 9) (0 4)) - - - Function: array-trim array trim ... + -- Function: array-trim array trim ... | Returns a subarray sharing contents with ARRAY except for slices removed from either side of each dimension. Each of the TRIMS is an exact integer indicating how much to trim. A positive S trims @@ -10570,33 +11349,25 @@ Subarrays lower bound. For example: - (array-trim '#(0 1 2 3 4) 1) => #1A(1 2 3 4) ;; shape is ((0 3)) - (array-trim '#(0 1 2 3 4) -1) => #1A(0 1 2 3) ;; shape is ((1 4)) - + (array-trim '#(0 1 2 3 4) 1) => #1A(1 2 3 4) | + (array-trim '#(0 1 2 3 4) -1) => #1A(0 1 2 3) | + (require 'array-for-each) (define (centered-difference ra) - (array-map - (array-trim ra 1) (array-trim ra -1))) - (define (forward-difference ra) - (array-map - (array-trim ra 1) ra)) - (define (backward-difference ra) - (array-map - ra (array-trim ra -1))) - + (array-map ra - (array-trim ra 1) (array-trim ra -1))) | + (centered-difference '#(0 1 3 5 9 22)) - => #1A(3 4 6 17) ;;shape is ((1 4)) - (backward-difference '#(0 1 3 5 9 22)) - => #1A(1 2 2 4 13) ;; shape is ((1 5)) - (forward-difference '#(0 1 3 5 9 22)) - => #(1 2 2 4 13) ;; shape is ((0 4)) + => #(1 2 2 4 13) | File: slib.info, Node: Array Mapping, Next: Association Lists, Prev: Subarrays, Up: Data Structures -Array Mapping -------------- +7.1.3 Array Mapping | +------------------- | -`(require 'array-for-each)' +`(require 'array-for-each)' - - Procedure: array-map! array0 proc array1 ... | + -- Procedure: 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 @@ -10604,31 +11375,31 @@ Array Mapping corresponding element in ARRAY0. The value returned is unspecified. The order of application is unspecified. - - Function: array-map prototype proc array1 array2 ... | - ARRAY2, ... must have the same number of dimensions as ARRAY1 and | - have a range for each index which includes the range for the | - corresponding index in ARRAY1. PROC is applied to each tuple of | - elements of ARRAY1, ARRAY2, ... and the result is stored as the | - corresponding element in a new array of type PROTOTYPE. The new | - array is returned. The order of application is unspecified. | - | - - Function: array-for-each proc array0 ... | + -- Function: array-map prototype proc array1 array2 ... | + ARRAY2, ... must have the same number of dimensions as ARRAY1 and + have a range for each index which includes the range for the + corresponding index in ARRAY1. PROC is applied to each tuple of + elements of ARRAY1, ARRAY2, ... and the result is stored as the + corresponding element in a new array of type PROTOTYPE. The new + array is returned. The order of application is unspecified. + + -- Function: array-for-each proc array0 ... | PROC is applied to each tuple of elements of ARRAY0 ... in row-major order. The value returned is unspecified. - - Function: array-indexes array | + -- Function: array-indexes array | Returns an array of lists of indexes for ARRAY such that, if LI is a list of indexes for which ARRAY is defined, (equal? LI (apply array-ref (array-indexes ARRAY) LI)). - - Procedure: array-index-map! array proc | + -- Procedure: 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. One can implement ARRAY-INDEXES as (define (array-indexes array) - (let ((ra (apply create-array '#() (array-shape array)))) + (let ((ra (apply make-array '#() (array-dimensions array)))) | (array-index-map! ra (lambda x x)) ra)) Another example: @@ -10637,7 +11408,7 @@ Array Mapping (array-index-map! v (lambda (i) i)) v)) - - Procedure: array-copy! source destination | + -- Procedure: array:copy! destination source | 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. @@ -10646,10 +11417,10 @@ Array Mapping File: slib.info, Node: Association Lists, Next: Byte, Prev: Array Mapping, Up: Data Structures -Association Lists ------------------ +7.1.4 Association Lists | +----------------------- | -`(require 'alist)' +`(require 'alist)' Alist functions provide utilities for treating a list of key-value pairs as an associative database. These functions take an equality @@ -10659,18 +11430,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 - 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: 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 @@ -10681,7 +11452,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 @@ -10690,302 +11461,302 @@ 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: Byte/Number Conversions, Prev: Association Lists, Up: Data Structures - | -Byte ----- -`(require 'byte)' +7.1.5 Byte | +---------- | + +`(require 'byte)' Some algorithms are expressed in terms of arrays of small integers. 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". +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 - K must be a valid index of BYTES, and BYTE must be a small | - nonnegative integer. `byte-set!' stores BYTE in element K of | - BYTES and returns an unspecified value. | - | - - Function: make-bytes k byte - - Function: make-bytes k | - `make-bytes' returns a newly allocated byte-array of length K. If | + -- Procedure: byte-set! bytes k byte | + K must be a valid index of BYTES, and BYTE must be a small + nonnegative integer. `byte-set!' stores BYTE in element K of + BYTES and returns an unspecified value. + + -- Function: make-bytes k byte | + -- Function: make-bytes k | + `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: bytes byte ... - Returns a newly allocated byte-array composed of the small | - nonnegative arguments. | + -- Function: bytes byte ... | + Returns a newly allocated byte-array composed of the small + nonnegative arguments. - - Function: bytes->list bytes - `bytes->list' returns a newly allocated list of the bytes that | - make up the given byte-array. | - | - - Function: list->bytes bytes - `list->bytes' returns a newly allocated byte-array formed from the | - small nonnegative integers in the list BYTES. | + -- Function: bytes->list bytes | + `bytes->list' returns a newly allocated list of the bytes that + make up the given byte-array. -`Bytes->list' and `list->bytes' are inverses so far as `equal?' is | -concerned. | + -- Function: list->bytes bytes | + `list->bytes' returns a newly allocated byte-array formed from the + small nonnegative integers in the list BYTES. - - Function: bytes-copy bytes | - Returns a newly allocated copy of the given BYTES. | - | - - Procedure: bytes-reverse! bytes | - Reverses the order of byte-array BYTES. | - | - - Function: bytes-reverse bytes | - Returns a newly allocated bytes-array consisting of the elements of | - BYTES in reverse order. | - | -Input and output of bytes should be with ports opened in "binary" mode | -(*note Input/Output::). Calling `open-file' with 'rb or 'wb modes | +`Bytes->list' and `list->bytes' are inverses so far as `equal?' is +concerned. + + -- Function: bytes-copy bytes | + Returns a newly allocated copy of the given BYTES. + + -- Procedure: bytes-reverse! bytes | + Reverses the order of byte-array BYTES. + + -- Function: bytes-reverse bytes | + Returns a newly allocated bytes-array consisting of the elements of + BYTES in reverse order. + +Input and output of bytes should be with ports opened in "binary" mode +(*note Input/Output::). Calling `open-file' with 'rb or 'wb modes argument will return a binary port if the Scheme implementation supports it. - | - - Function: write-byte byte port - - Function: write-byte byte | + + -- Function: write-byte byte port | + -- Function: write-byte byte | 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 - returned by `current-output-port'. - | - - Function: read-byte port - - Function: read-byte | + returned by `current-output-port'. + + -- Function: read-byte port | + -- Function: read-byte | 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 | + available, an end-of-file object is returned. PORT may be omitted, in which case it defaults to the value returned by - `current-input-port'. + `current-input-port'. + +When reading and writing binary numbers with `read-bytes' and +`write-bytes', the sign of the length argument determines the +endianness (order) of bytes. Positive treats them as big-endian, the +first byte input or output is highest order. Negative treats them as +little-endian, the first byte input or output is the lowest order. + +Once read in, SLIB treats byte sequences as big-endian. The multi-byte +sequences produced and used by number conversion routines *note +Byte/Number Conversions:: are always big-endian. + + -- Function: read-bytes n port | + -- Function: read-bytes n | + `read-bytes' returns a newly allocated bytes-array filled with + `(abs N)' bytes read from PORT. If N is positive, then the first + byte read is stored at index 0; otherwise the last byte read is + stored at index 0. Note that the length of the returned string + will be less than `(abs N)' if PORT reaches end-of-file. + + PORT may be omitted, in which case it defaults to the value + returned by `current-input-port'. + + -- Function: write-bytes bytes n port | + -- Function: write-bytes bytes n | + `write-bytes' writes `(abs N)' bytes to output-port PORT. If N is + positive, then the first byte written is index 0 of BYTES; + otherwise the last byte written is index 0 of BYTES. + `write-bytes' returns an unspecified value. + + PORT may be omitted, in which case it defaults to the value + returned by `current-output-port'. -When reading and writing binary numbers with `read-bytes' and | -`write-bytes', the sign of the length argument determines the | -endianness (order) of bytes. Positive treats them as big-endian, the | -first byte input or output is highest order. Negative treats them as | -little-endian, the first byte input or output is the lowest order. | - | -Once read in, SLIB treats byte sequences as big-endian. The multi-byte | -sequences produced and used by number conversion routines *note | -Byte/Number Conversions:: are always big-endian. | - | - - Function: read-bytes n port | - - Function: read-bytes n | - `read-bytes' returns a newly allocated bytes-array filled with | - `(abs N)' bytes read from PORT. If N is positive, then the first | - byte read is stored at index 0; otherwise the last byte read is | - stored at index 0. Note that the length of the returned string | - will be less than `(abs N)' if PORT reaches end-of-file. | - | - PORT may be omitted, in which case it defaults to the value | - returned by `current-input-port'. | - | - - Function: write-bytes bytes n port | - - Function: write-bytes bytes n | - `write-bytes' writes `(abs N)' bytes to output-port PORT. If N is | - positive, then the first byte written is index 0 of BYTES; | - otherwise the last byte written is index 0 of BYTES. | - `write-bytes' returns an unspecified value. | - | - PORT may be omitted, in which case it defaults to the value | - returned by `current-output-port'. | - | -`substring-read!' and `substring-write' provide lower-level procedures | -for reading and writing blocks of bytes. The relative size of START | -and END determines the order of writing. | - | - - Procedure: substring-read! string start end port | - - Procedure: substring-read! string start end | - Fills STRING with up to `(abs (- START END))' bytes read from | - PORT. The first byte read is stored at index STRING. | - `substring-read!' returns the number of bytes read. | - | - PORT may be omitted, in which case it defaults to the value | - returned by `current-input-port'. | - | - - Function: substring-write string start end port | - - Function: substring-write string start end | - `substring-write' writes `(abs (- START END))' bytes to | - output-port PORT. The first byte written is index START of | - STRING. `substring-write' returns the number of bytes written. | - | - PORT may be omitted, in which case it defaults to the value | - returned by `current-output-port'. | +`substring-read!' and `substring-write' provide lower-level procedures +for reading and writing blocks of bytes. The relative size of START +and END determines the order of writing. + + -- Procedure: substring-read! string start end port | + -- Procedure: substring-read! string start end | + Fills STRING with up to `(abs (- START END))' bytes read from + PORT. The first byte read is stored at index STRING. + `substring-read!' returns the number of bytes read. + + PORT may be omitted, in which case it defaults to the value + returned by `current-input-port'. + + -- Function: substring-write string start end port | + -- Function: substring-write string start end | + `substring-write' writes `(abs (- START END))' bytes to + output-port PORT. The first byte written is index START of + STRING. `substring-write' returns the number of bytes written. + + PORT may be omitted, in which case it defaults to the value + returned by `current-output-port'. File: slib.info, Node: Byte/Number Conversions, Next: MAT-File Format, Prev: Byte, Up: Data Structures - | -Byte/Number Conversions | ------------------------ | - | -`(require 'byte-number)' | - | -The multi-byte sequences produced and used by numeric conversion | -routines are always big-endian. Endianness can be changed during | -reading and writing bytes using `read-bytes' and `write-bytes' *Note | -read-bytes: Byte. | - | -The sign of the length argument to bytes/integer conversion procedures | -determines the signedness of the number. | - | - - Function: bytes->integer bytes n | - Converts the first `(abs N)' bytes of big-endian BYTES array to an | - integer. If N is negative then the integer coded by the bytes are | - treated as two's-complement (can be negative). | - | - (bytes->integer (bytes 0 0 0 15) -4) => 15 | - (bytes->integer (bytes 0 0 0 15) 4) => 15 | - (bytes->integer (bytes 255 255 255 255) -4) => -1 | - (bytes->integer (bytes 255 255 255 255) 4) => 4294967295 | - (bytes->integer (bytes 128 0 0 0) -4) => -2147483648 | - (bytes->integer (bytes 128 0 0 0) 4) => 2147483648 | - | - - Function: integer->bytes n len | - Converts the integer N to a byte-array of `(abs N)' bytes. If N | - and LEN are both negative, then the bytes in the returned array | - are coded two's-complement. | - | - (bytes->list (integer->bytes 15 -4)) => (0 0 0 15) | - (bytes->list (integer->bytes 15 4)) => (0 0 0 15) | + +7.1.6 Byte/Number Conversions | +----------------------------- | + +`(require 'byte-number)' + +The multi-byte sequences produced and used by numeric conversion +routines are always big-endian. Endianness can be changed during +reading and writing bytes using `read-bytes' and `write-bytes' *Note +read-bytes: Byte. + +The sign of the length argument to bytes/integer conversion procedures +determines the signedness of the number. + + -- Function: bytes->integer bytes n | + Converts the first `(abs N)' bytes of big-endian BYTES array to an + integer. If N is negative then the integer coded by the bytes are + treated as two's-complement (can be negative). + + (bytes->integer (bytes 0 0 0 15) -4) => 15 + (bytes->integer (bytes 0 0 0 15) 4) => 15 + (bytes->integer (bytes 255 255 255 255) -4) => -1 + (bytes->integer (bytes 255 255 255 255) 4) => 4294967295 + (bytes->integer (bytes 128 0 0 0) -4) => -2147483648 + (bytes->integer (bytes 128 0 0 0) 4) => 2147483648 + + -- Function: integer->bytes n len | + Converts the integer N to a byte-array of `(abs N)' bytes. If N + and LEN are both negative, then the bytes in the returned array + are coded two's-complement. + + (bytes->list (integer->bytes 15 -4)) => (0 0 0 15) + (bytes->list (integer->bytes 15 4)) => (0 0 0 15) (bytes->list (integer->bytes -1 -4)) => (255 255 255 255) (bytes->list (integer->bytes 4294967295 4)) => (255 255 255 255) - (bytes->list (integer->bytes -2147483648 -4)) => (128 0 0 0) | - (bytes->list (integer->bytes 2147483648 4)) => (128 0 0 0) | - | - - Function: bytes->ieee-float bytes | - BYTES must be a 4-element byte-array. `bytes->ieee-float' | - calculates and returns the value of BYTES interpreted as a | - big-endian IEEE 4-byte (32-bit) number. | - | - (bytes->ieee-float (bytes #x40 0 0 0)) => 2.0 | - (bytes->ieee-float (bytes #x40 #xd0 0 0)) => 6.5 | - (bytes->ieee-float (bytes #xc0 #xd0 0 0)) => -6.5 | - | - (bytes->ieee-float (bytes 0 #x80 0 0)) => 11.754943508222875e-39 | - (bytes->ieee-float (bytes 0 #x40 0 0)) => 5.877471754111437e-39 | - (bytes->ieee-float (bytes 0 0 0 1)) => 1.401298464324817e-45 | - | - (bytes->ieee-float (bytes #xff #x80 0 0)) => -1/0 | - (bytes->ieee-float (bytes #x7f #x80 0 0)) => 1/0 | - (bytes->ieee-float (bytes #x7f #x80 0 1)) => 0/0 | - | - - Function: bytes->ieee-double bytes | - BYTES must be a 8-element byte-array. `bytes->ieee-double' | - calculates and returns the value of BYTES interpreted as a | - big-endian IEEE 8-byte (64-bit) number. | - | - (bytes->ieee-double (bytes 0 0 0 0 0 0 0 0)) => 0.0 | - (bytes->ieee-double (bytes #x40 0 0 0 0 0 0 0)) => 2 | - (bytes->ieee-double (bytes #x40 #x1A 0 0 0 0 0 0)) => 6.5 | - (bytes->ieee-double (bytes #xC0 #x1A 0 0 0 0 0 0)) => -6.5 | - | - (bytes->ieee-double (bytes 0 8 0 0 0 0 0 0)) => 11.125369292536006e-309 | - (bytes->ieee-double (bytes 0 4 0 0 0 0 0 0)) => 5.562684646268003e-309 | - (bytes->ieee-double (bytes 0 0 0 0 0 0 0 1)) => 4.0e-324 | - | - (bytes->ieee-double (bytes #xFF #xF0 0 0 0 0 0 0)) => -1/0 | - (bytes->ieee-double (bytes #x7F #xF0 0 0 0 0 0 0)) => 1/0 | - (bytes->ieee-double (bytes #x7F #xF8 0 0 0 0 0 0)) => 0/0 | - | - - Function: ieee-float->bytes x | - Returns a 4-element byte-array encoding the IEEE single-precision | - floating-point of X. | - | + (bytes->list (integer->bytes -2147483648 -4)) => (128 0 0 0) + (bytes->list (integer->bytes 2147483648 4)) => (128 0 0 0) + + -- Function: bytes->ieee-float bytes | + BYTES must be a 4-element byte-array. `bytes->ieee-float' + calculates and returns the value of BYTES interpreted as a + big-endian IEEE 4-byte (32-bit) number. + + (bytes->ieee-float (bytes #x40 0 0 0)) => 2.0 + (bytes->ieee-float (bytes #x40 #xd0 0 0)) => 6.5 + (bytes->ieee-float (bytes #xc0 #xd0 0 0)) => -6.5 + + (bytes->ieee-float (bytes 0 #x80 0 0)) => 11.754943508222875e-39 + (bytes->ieee-float (bytes 0 #x40 0 0)) => 5.877471754111437e-39 + (bytes->ieee-float (bytes 0 0 0 1)) => 1.401298464324817e-45 + + (bytes->ieee-float (bytes #xff #x80 0 0)) => -1/0 + (bytes->ieee-float (bytes #x7f #x80 0 0)) => 1/0 + (bytes->ieee-float (bytes #x7f #x80 0 1)) => 0/0 + + -- Function: bytes->ieee-double bytes | + BYTES must be a 8-element byte-array. `bytes->ieee-double' + calculates and returns the value of BYTES interpreted as a + big-endian IEEE 8-byte (64-bit) number. + + (bytes->ieee-double (bytes 0 0 0 0 0 0 0 0)) => 0.0 + (bytes->ieee-double (bytes #x40 0 0 0 0 0 0 0)) => 2 + (bytes->ieee-double (bytes #x40 #x1A 0 0 0 0 0 0)) => 6.5 + (bytes->ieee-double (bytes #xC0 #x1A 0 0 0 0 0 0)) => -6.5 + + (bytes->ieee-double (bytes 0 8 0 0 0 0 0 0)) => 11.125369292536006e-309 + (bytes->ieee-double (bytes 0 4 0 0 0 0 0 0)) => 5.562684646268003e-309 + (bytes->ieee-double (bytes 0 0 0 0 0 0 0 1)) => 4.0e-324 + + (bytes->ieee-double (bytes #xFF #xF0 0 0 0 0 0 0)) => -1/0 + (bytes->ieee-double (bytes #x7F #xF0 0 0 0 0 0 0)) => 1/0 + (bytes->ieee-double (bytes #x7F #xF8 0 0 0 0 0 0)) => 0/0 + + -- Function: ieee-float->bytes x | + Returns a 4-element byte-array encoding the IEEE single-precision + floating-point of X. + (bytes->list (ieee-float->bytes 2.0)) => (64 0 0 0) (bytes->list (ieee-float->bytes 6.5)) => (64 208 0 0) (bytes->list (ieee-float->bytes -6.5)) => (192 208 0 0) - | + (bytes->list (ieee-float->bytes 11.754943508222875e-39)) => ( 0 128 0 0) (bytes->list (ieee-float->bytes 5.877471754111438e-39)) => ( 0 64 0 0) (bytes->list (ieee-float->bytes 1.401298464324817e-45)) => ( 0 0 0 1) - | + (bytes->list (ieee-float->bytes -1/0)) => (255 128 0 0) (bytes->list (ieee-float->bytes 1/0)) => (127 128 0 0) (bytes->list (ieee-float->bytes 0/0)) => (127 128 0 1) - | - - Function: ieee-double->bytes x | - Returns a 8-element byte-array encoding the IEEE double-precision | - floating-point of X. | - | - (bytes->list (ieee-double->bytes 2.0)) => (64 0 0 0 0 0 0 0) | - (bytes->list (ieee-double->bytes 6.5)) => (64 26 0 0 0 0 0 0) | - (bytes->list (ieee-double->bytes -6.5)) => (192 26 0 0 0 0 0 0) | - | - (bytes->list (ieee-double->bytes 11.125369292536006e-309)) | - => ( 0 8 0 0 0 0 0 0) | - (bytes->list (ieee-double->bytes 5.562684646268003e-309)) | - => ( 0 4 0 0 0 0 0 0) | - (bytes->list (ieee-double->bytes 4.0e-324)) | - => ( 0 0 0 0 0 0 0 1) | - | - (bytes->list (ieee-double->bytes -1/0)) => (255 240 0 0 0 0 0 0) | - (bytes->list (ieee-double->bytes 1/0)) => (127 240 0 0 0 0 0 0) | - (bytes->list (ieee-double->bytes 0/0)) => (127 248 0 0 0 0 0 0) | - | -Byte Collation Order | -.................... | - | -The `string<?' ordering of big-endian byte-array representations of | -fixed and IEEE floating-point numbers agrees with the numerical | -ordering only when those numbers are non-negative. | - | -Straighforward modification of these formats can extend the | -byte-collating order to work for their entire ranges. This agreement | -enables the full range of numbers as keys in | -"indexed-sequential-access-method" databases. | - | - - Procedure: integer-byte-collate! byte-vector | - Modifies sign bit of BYTE-VECTOR so that `string<?' ordering of | - two's-complement byte-vectors matches numerical order. | - `integer-byte-collate!' returns BYTE-VECTOR and is its own | - functional inverse. | - | - - Function: integer-byte-collate byte-vector | - Returns copy of BYTE-VECTOR with sign bit modified so that | - `string<?' ordering of two's-complement byte-vectors matches | - numerical order. `integer-byte-collate' is its own functional | - inverse. | - | - - Procedure: ieee-byte-collate! byte-vector | - Modifies BYTE-VECTOR so that `string<?' ordering of IEEE | - floating-point byte-vectors matches numerical order. | - `ieee-byte-collate!' returns BYTE-VECTOR. | - | - - Procedure: ieee-byte-decollate! byte-vector | - Given BYTE-VECTOR modified by `IEEE-byte-collate!', reverses the | - BYTE-VECTOR modifications. | - | - - Function: ieee-byte-collate byte-vector | - Returns copy of BYTE-VECTOR encoded so that `string<?' ordering of | - IEEE floating-point byte-vectors matches numerical order. | - | - - Function: ieee-byte-decollate byte-vector | - Given BYTE-VECTOR returned by `IEEE-byte-collate', reverses the | - BYTE-VECTOR modifications. | - | + + -- Function: ieee-double->bytes x | + Returns a 8-element byte-array encoding the IEEE double-precision + floating-point of X. + + (bytes->list (ieee-double->bytes 2.0)) => (64 0 0 0 0 0 0 0) + (bytes->list (ieee-double->bytes 6.5)) => (64 26 0 0 0 0 0 0) + (bytes->list (ieee-double->bytes -6.5)) => (192 26 0 0 0 0 0 0) + + (bytes->list (ieee-double->bytes 11.125369292536006e-309)) + => ( 0 8 0 0 0 0 0 0) + (bytes->list (ieee-double->bytes 5.562684646268003e-309)) + => ( 0 4 0 0 0 0 0 0) + (bytes->list (ieee-double->bytes 4.0e-324)) + => ( 0 0 0 0 0 0 0 1) + + (bytes->list (ieee-double->bytes -1/0)) => (255 240 0 0 0 0 0 0) + (bytes->list (ieee-double->bytes 1/0)) => (127 240 0 0 0 0 0 0) + (bytes->list (ieee-double->bytes 0/0)) => (127 248 0 0 0 0 0 0) + +Byte Collation Order +.................... + +The `string<?' ordering of big-endian byte-array representations of +fixed and IEEE floating-point numbers agrees with the numerical +ordering only when those numbers are non-negative. + +Straighforward modification of these formats can extend the +byte-collating order to work for their entire ranges. This agreement +enables the full range of numbers as keys in +"indexed-sequential-access-method" databases. + + -- Procedure: integer-byte-collate! byte-vector | + Modifies sign bit of BYTE-VECTOR so that `string<?' ordering of + two's-complement byte-vectors matches numerical order. + `integer-byte-collate!' returns BYTE-VECTOR and is its own + functional inverse. + + -- Function: integer-byte-collate byte-vector | + Returns copy of BYTE-VECTOR with sign bit modified so that + `string<?' ordering of two's-complement byte-vectors matches + numerical order. `integer-byte-collate' is its own functional + inverse. + + -- Procedure: ieee-byte-collate! byte-vector | + Modifies BYTE-VECTOR so that `string<?' ordering of IEEE + floating-point byte-vectors matches numerical order. + `ieee-byte-collate!' returns BYTE-VECTOR. + + -- Procedure: ieee-byte-decollate! byte-vector | + Given BYTE-VECTOR modified by `IEEE-byte-collate!', reverses the + BYTE-VECTOR modifications. + + -- Function: ieee-byte-collate byte-vector | + Returns copy of BYTE-VECTOR encoded so that `string<?' ordering of + IEEE floating-point byte-vectors matches numerical order. + + -- Function: ieee-byte-decollate byte-vector | + Given BYTE-VECTOR returned by `IEEE-byte-collate', reverses the + BYTE-VECTOR modifications. + File: slib.info, Node: MAT-File Format, Next: Portable Image Files, Prev: Byte/Number Conversions, Up: Data Structures - | -MAT-File Format ---------------- -`(require 'matfile)' +7.1.7 MAT-File Format | +--------------------- | + +`(require 'matfile)' `http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf' @@ -10994,16 +11765,16 @@ files. MAT-files written from big-endian or little-endian computers having IEEE format numbers are currently supported. Support for files written from VAX or Cray machines could also be added. -The numeric and text matrix types handled; support for "sparse" -matrices awaits a sample file. +The numeric and text matrix types handled; support for "sparse" matrices | +awaits a sample file. | - - Function: matfile:read filename + -- Function: matfile:read filename | FILENAME should be a string naming an existing file containing a MATLAB Version 4 MAT-File. The `matfile:read' procedure reads matrices from the file and returns a list of the results; a list of the name string and array for each matrix. - - Function: matfile:load filename + -- Function: matfile:load filename | FILENAME should be a string naming an existing file containing a MATLAB Version 4 MAT-File. The `matfile:load' procedure reads matrices from the file and defines the `string-ci->symbol' for @@ -11013,14 +11784,14 @@ matrices awaits a sample file. File: slib.info, Node: Portable Image Files, Next: Collections, Prev: MAT-File Format, Up: Data Structures -Portable Image Files --------------------- +7.1.8 Portable Image Files | +-------------------------- | -`(require 'pnm)' +`(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: + -- 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. @@ -11044,16 +11815,16 @@ Portable Image Files 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 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 + -- 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. + "portable bitmap graphics" file named by PATH read into it. - - Function: pnm:array-write type array maxval path comment ... | + -- Function: pnm:array-write type array maxval path comment ... | 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'. @@ -11062,10 +11833,10 @@ Portable Image Files File: slib.info, Node: Collections, Next: Dynamic Data Type, Prev: Portable Image Files, Up: Data Structures -Collections ------------ +7.1.9 Collections | +----------------- | -`(require 'collect)' +`(require 'collect)' Routines for managing collections. Collections are aggregate data structures supporting iteration over their elements, similar to the @@ -11094,12 +11865,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 collection1 ... - - Procedure: do-elts proc collection1 ... + -- 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 @@ -11114,8 +11885,8 @@ operations. (map-elts + (list 1 2 3) (vector 1 2 3)) => #(2 4 6) - - Procedure: map-keys proc collection1 ... - - Procedure: do-keys proc collection1 ... + -- 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 elements. @@ -11124,16 +11895,16 @@ operations. (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 collection1 ... - A generalization of the list-based `reduce-init' (*note Lists as | - sequences::) to collections which will shadow the list-based | - version if `(require 'collect)' follows `(require | - 'common-list-functions)' (*note Common List Functions::). + -- Function: reduce proc seed collection1 ... | + A generalization of the list-based `reduce-init' (*note Lists as + sequences::) to collections which will shadow the list-based + version if `(require 'collect)' follows `(require + 'common-list-functions)' (*note Common List Functions::). Examples: (reduce + 0 (vector 1 2 3)) @@ -11141,7 +11912,7 @@ operations. (reduce union '() '((a b c) (b c d) (d a))) => (c b d a). - - Function: any? pred collection1 ... + -- Function: any? pred collection1 ... | A generalization of the list-based `some' (*note Lists as sequences::) to collections. @@ -11149,7 +11920,7 @@ operations. (any? odd? (list 2 3 4 5)) => #t - - Function: every? pred collection1 ... + -- Function: every? pred collection1 ... | A generalization of the list-based `every' (*note Lists as sequences::) to collections. @@ -11157,15 +11928,15 @@ operations. (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. @@ -11174,7 +11945,7 @@ operations. (define-operation (LOOKUP table key failure-object)) (define-operation (ASSOCIATE! table key value)) ;; returns key (define-operation (REMOVE! table key)) ;; returns value - + (define (MAKE-SIMPLE-TABLE) (let ( (table (list)) ) (object @@ -11231,28 +12002,28 @@ operations. File: slib.info, Node: Dynamic Data Type, Next: Hash Tables, Prev: Collections, Up: Data Structures -Dynamic Data Type ------------------ +7.1.10 Dynamic Data Type | +------------------------ | -`(require 'dynamic)' +`(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 @@ -11266,12 +12037,12 @@ Dynamic Data Type File: slib.info, Node: Hash Tables, Next: Object, Prev: Dynamic Data Type, Up: Data Structures -Hash Tables ------------ +7.1.11 Hash Tables | +------------------ | -`(require 'hash-table)' +`(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 @@ -11279,7 +12050,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. @@ -11287,61 +12058,61 @@ 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 + -- 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. - - Function: hash-rehasher pred | - `hash-rehasher' accepts a hash table predicate and returns a | - function of two arguments HASHTAB and NEW-K which is specialized | - for that predicate. | - | - This function is used for nondestrutively resizing a hash table. | - HASHTAB should be an existing hash-table using PRED, NEW-K is the | - size of a new hash table to be returned. The new hash table will | - have all of the associations of the old hash table. | - | + -- Function: hash-rehasher pred | + `hash-rehasher' accepts a hash table predicate and returns a + function of two arguments HASHTAB and NEW-K which is specialized + for that predicate. + + This function is used for nondestrutively resizing a hash table. + HASHTAB should be an existing hash-table using PRED, NEW-K is the + size of a new hash table to be returned. The new hash table will + have all of the associations of the old hash table. + File: slib.info, Node: Object, Next: Priority Queues, Prev: Hash Tables, Up: Data Structures -Macroless Object System ------------------------ +7.1.12 Macroless Object System | +------------------------------ | -`(require 'object)' +`(require 'object)' This is the Macroless Object System written by Wade Humeniuk (whumeniu@datap.ca). Conceptual Tributes: *Note Yasos::, MacScheme's %object, CLOS, Lack of R4RS macros. -Concepts --------- +7.1.13 Concepts | +--------------- | OBJECT An object is an ordered association-list (by `eq?') of methods @@ -11370,10 +12141,10 @@ PREDICATE A object's method asscociated with a generic-predicate. Returns `#t'. -Procedures ----------- +7.1.14 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 @@ -11381,48 +12152,48 @@ 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. - - Function: make-generic-predicate + -- 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 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. -Examples --------- +7.1.15 Examples | +--------------- | (require 'object) (define instantiate (make-generic-method)) - + (define (make-instance-object . ancestors) (define self (apply make-object (map (lambda (obj) (instantiate obj)) ancestors))) (make-method! self instantiate (lambda (self) self)) self) - + (define who (make-generic-method)) (define imigrate! (make-generic-method)) (define emigrate! (make-generic-method)) @@ -11430,7 +12201,7 @@ Examples (define name (make-generic-method)) (define address (make-generic-method)) (define members (make-generic-method)) - + (define society (let () (define self (make-instance-object)) @@ -11454,7 +12225,7 @@ Examples population))) (make-method! self members (lambda (self) population)) self)) - + (define (make-person %name %address) (define self (make-instance-object society)) (make-method! self name (lambda (self) %name)) @@ -11469,8 +12240,8 @@ Examples (imigrate! self) self) -Inverter Documentation -...................... +7.1.15.1 Inverter Documentation | +............................... | Inheritance: <inverter>::(<number> <description>) @@ -11482,8 +12253,8 @@ Inheritance: <inverter>::invert <inverter>::inverter? -Number Documention -.................. +7.1.15.2 Number Documention | +........................... | Inheritance <number>::() @@ -11493,8 +12264,8 @@ Inheritance <number>::value <number>::set-value! -Inverter code -............. +7.1.15.3 Inverter code | +...................... | (require 'object) @@ -11509,20 +12280,20 @@ Inverter code (define inverter? (make-generic-predicate)) (define describe (make-generic-method)) (define help (make-generic-method)) - + (define (make-number x) (define self (make-object)) (make-method! self value (lambda (this) x)) (make-method! self set-value! (lambda (this new-value) (set! x new-value))) self) - + (define (make-description str) (define self (make-object)) (make-method! self describe (lambda (this) str)) (make-method! self help (lambda (this) "Help not available")) self) - + (define (make-inverter) (let* ((self (make-object (make-number 1) @@ -11536,106 +12307,107 @@ Inverter code (display "Inverter Methods:") (newline) (display " (value inverter) ==> n") (newline))) self)) - + ;;;; Try it out - + (define invert! (make-generic-method)) - + (define x (make-inverter)) - + (make-method! x invert! (lambda (x) (set-value! x (/ 1 (value x))))) - + (value x) => 1 (set-value! x 33) => undefined (invert! x) => undefined (value x) => 1/33 - + (unmake-method! x invert!) => undefined - + (invert! x) error--> ERROR: Method not supported: x File: slib.info, Node: Priority Queues, Next: Queues, Prev: Object, Up: Data Structures -Priority Queues ---------------- +7.1.16 Priority Queues | +---------------------- | -`(require 'priority-queue)' +`(require 'priority-queue)' -This algorithm for priority queues is due to `Introduction to | -Algorithms' by T. Cormen, C. Leiserson, R. Rivest. 1989 MIT Press. | - | - - Function: make-heap pred<? +This algorithm for priority queues is due to `Introduction to +Algorithms' by T. Cormen, C. Leiserson, R. Rivest. 1989 MIT Press. + + -- 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. - - Procedure: heap-extract-max! heap | + -- Procedure: 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. - | + File: slib.info, Node: Queues, Next: Records, Prev: Priority Queues, Up: Data Structures -Queues ------- +7.1.17 Queues | +------------- | -`(require 'queue)' +`(require 'queue)' A "queue" is a list where elements can be added to both the front and rear, and removed from the front (i.e., they are what are often called -"dequeues"). A queue may also be used like a stack. +"dequeues"). A queue may also be used like a stack. - - Function: make-queue + -- 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: enqueue! q datum + -- Procedure: enqueue! q datum | Adds DATUM to the rear of queue Q. - - Procedure: dequeue! q | - - Procedure: queue-pop! 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. | - All of the following functions raise an error if the queue Q is empty. | - | - - Procedure: dequeue-all! q + -- Procedure: dequeue! q | + -- Procedure: queue-pop! 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. + + All of the following functions raise an error if the queue Q is empty. + + -- Procedure: dequeue-all! q | Removes and returns (the list) of all contents of queue Q. - | - - 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. - | + File: slib.info, Node: Records, Prev: Queues, Up: Data Structures -Records -------- +7.1.18 Records | +-------------- | -`(require 'record)' +`(require 'record)' 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 @@ -11645,7 +12417,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, @@ -11658,13 +12430,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 @@ -11673,7 +12445,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 @@ -11699,8 +12471,8 @@ supported. File: slib.info, Node: Sorting and Searching, Next: Procedures, Prev: Data Structures, Up: Other Packages -Sorting and Searching -===================== +7.2 Sorting and Searching | +========================= | * Menu: @@ -11718,10 +12490,10 @@ Sorting and Searching File: slib.info, Node: Common List Functions, Next: Tree Operations, Prev: Sorting and Searching, Up: Sorting and Searching -Common List Functions ---------------------- +7.2.1 Common List Functions | +--------------------------- | -`(require 'common-list-functions)' +`(require 'common-list-functions)' The procedures below follow the Common LISP equivalents apart from optional arguments in some cases. @@ -11737,11 +12509,11 @@ optional arguments in some cases. File: slib.info, Node: List construction, Next: Lists as sets, Prev: Common List Functions, Up: Common List Functions -List construction -................. +7.2.1.1 List construction | +......................... | - - Function: make-list k - - 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. @@ -11751,7 +12523,7 @@ List construction (make-list 5 'foo) => (foo foo foo foo foo) - - Function: list* obj1 obj2 ... + -- 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.: @@ -11765,7 +12537,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 @@ -11791,13 +12563,13 @@ List construction File: slib.info, Node: Lists as sets, Next: Lists as sequences, Prev: List construction, Up: Common List Functions -Lists as sets -............. +7.2.1.2 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)'. @@ -11808,7 +12580,7 @@ as sets. (adjoin 'foo '(bar baz bang)) => (foo bar baz bang) - - Function: union l1 l2 + -- Function: union l1 l2 | `union' returns a list of all elements that are in L1 or L2. Duplicates between L1 and L2 are culled. Duplicates within L1 or within L2 may or may not be removed. @@ -11819,7 +12591,7 @@ as sets. (union '(0 1 2 3 4) '(3 4 5 6)) => (5 6 0 1 2 3 4) - - Function: intersection l1 l2 + -- Function: intersection l1 l2 | `intersection' returns a list of all elements that are in both L1 and L2. @@ -11829,7 +12601,7 @@ as sets. (intersection '(1 2 3 4) '(5 6 7 8)) => () - - Function: set-difference l1 l2 + -- Function: set-difference l1 l2 | `set-difference' returns a list of all elements that are in L1 but not in L2. @@ -11839,7 +12611,7 @@ as sets. (set-difference '(1 2 3 4) '(1 2 3 4 5 6)) => () - - Function: subset? list1 list2 + -- Function: subset? list1 list2 | Returns `#t' if every element of LIST1 is `eqv?' an element of LIST2; otherwise returns `#f'. @@ -11849,7 +12621,7 @@ as sets. (subset? '(1 2 3 4) '(6 5 4 3 2 1 0)) => #t - - Function: member-if pred lst + -- Function: member-if pred lst | `member-if' returns the list headed by the first element of LST to satisfy `(PRED ELEMENT)'. `Member-if' returns `#f' if PRED returns `#f' for every ELEMENT in LST. @@ -11860,7 +12632,7 @@ as sets. (member-if number? '(a 2 b 4)) => (2 b 4) - - Function: some pred lst1 lst2 ... + -- 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. @@ -11871,53 +12643,53 @@ as sets. Example: (some odd? '(1 2 3 4)) => #t - + (some odd? '(2 4 6 8)) => #f - + (some > '(1 3) '(2 4)) => #f - - Function: every pred lst1 lst2 ... + -- Function: every pred lst1 lst2 ... | `every' is analogous to `some' except it returns `#t' if every application of PRED is `#t' and `#f' otherwise. Example: (every even? '(1 2 3 4)) => #f - + (every even? '(2 4 6 8)) => #t - + (every > '(2 3) '(1 4)) => #f - - Function: notany pred lst1 ... + -- 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 lst1 ... + -- Function: notevery pred lst1 ... | `notevery' is analogous to `some' but returns `#t' as soon as an application of PRED returns `#f', and `#f' otherwise. Example: (notevery even? '(1 2 3 4)) => #t - + (notevery even? '(2 4 6 8)) => #f - - Function: list-of?? predicate + -- 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 + -- 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 + -- 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 @@ -11925,7 +12697,7 @@ as sets. 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 + -- 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. @@ -11933,14 +12705,14 @@ as sets. Example: (find-if number? '(foo 1 bar 2)) => 1 - + (find-if number? '(foo bar baz bang)) => #f - + (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 @@ -11949,22 +12721,22 @@ as sets. Example: (remove 1 '(1 2 1 3 1 4 1 5)) => (2 3 4 5) - + (remove 'foo '(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. Example: (remove-if number? '(1 2 3 4)) => () - + (remove-if even? '(1 2 3 4 5 6 7 8)) => (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. @@ -11974,36 +12746,36 @@ as sets. (remove-if-not odd? '(1 2 3 4 5 6 7 8)) => (1 3 5 7) - - Function: has-duplicates? lst + -- Function: has-duplicates? lst | returns `#t' if 2 members of LST are `equal?', `#f' otherwise. Example: (has-duplicates? '(1 2 3 4)) => #f - + (has-duplicates? '(2 4 3 4)) => #t 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)) => (1 2 3 4) - + (remove-duplicates '(2 4 3 4)) => (2 4 3) File: slib.info, Node: Lists as sequences, Next: Destructive list operations, Prev: Lists as sets, Up: Common List Functions -Lists as sequences -.................. +7.2.1.3 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. @@ -12015,7 +12787,7 @@ 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 @@ -12047,17 +12819,17 @@ Lists as sequences in terms of `reduce' and a combinator elsewhere called "C". ;;; Contributed by Jussi Piitulainen (jpiitula @ ling.helsinki.fi) - + (define commute (lambda (f) (lambda (x y) (f y x)))) - + (define reverse (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 @@ -12074,7 +12846,7 @@ Lists as sequences (sum) == (reduce-init + 0 '()) => 0 - + (reduce-init string-append "@" '("hello" "cruel" "world")) == (string-append (string-append (string-append "@" "hello") @@ -12089,7 +12861,7 @@ Lists as sequences Example: ;;; Real-world example: Insertion sort using reduce-init. - + (define (insert l item) (if (null? l) (list item) @@ -12097,7 +12869,7 @@ Lists as sequences (cons (car l) (insert (cdr l) item)) (cons item l)))) (define (insertion-sort l) (reduce-init insert '() l)) - + (insertion-sort '(3 1 4 1 5) == (reduce-init insert () (3 1 4 1 5)) == (insert (insert (insert (insert (insert () 3) 1) 4) 1) 5) @@ -12107,7 +12879,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. @@ -12117,7 +12889,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: @@ -12127,13 +12899,13 @@ Lists as sequences => () `last' and `butlast' split a list into two parts when given identical -arugments. +arguments. | (last '(a b c d e) 2) => (d e) (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)' @@ -12143,7 +12915,7 @@ 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: @@ -12153,7 +12925,7 @@ arugments. => (a b c d) `nthcdr' and `butnthcdr' split a list into two parts when given -identical arugments. +identical arguments. | (nthcdr 2 '(a b c d e)) => (c d e) (butnthcdr 2 '(a b c d e)) @@ -12162,13 +12934,13 @@ identical arugments. File: slib.info, Node: Destructive list operations, Next: Non-List functions, Prev: Lists as sequences, Up: Common List Functions -Destructive list operations -........................... +7.2.1.4 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::). @@ -12196,7 +12968,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!'. @@ -12212,14 +12984,13 @@ mutation is undefined. out that (set! lst (nreverse lst)) - is the proper usage, not (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: @@ -12228,7 +12999,7 @@ mutation is undefined. => (bar baz bang) lst => (foo bar baz bang) - + (define lst (list 1 2 3 4 5 6 7 8 9)) (delete-if odd? lst) => (2 4 6 8) @@ -12240,7 +13011,6 @@ mutation is undefined. value. It needs to be pointed out that (set! lst (delete el lst)) - is the proper usage, not (delete el lst) The examples should suffice to show why this is the case. @@ -12248,10 +13018,10 @@ mutation is undefined. File: slib.info, Node: Non-List functions, Prev: Destructive list operations, Up: Common List Functions -Non-List functions -.................. +7.2.1.5 Non-List functions | +.......................... | - - Function: and? arg1 ... + -- 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 @@ -12263,7 +13033,7 @@ Non-List functions (and #f 1 2) => #f - - Function: or? arg1 ... + -- 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'.) @@ -12274,7 +13044,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) @@ -12287,17 +13057,17 @@ Non-List functions File: slib.info, Node: Tree Operations, Next: Chapter Ordering, Prev: Common List Functions, Up: Sorting and Searching -Tree operations ---------------- +7.2.2 Tree operations | +--------------------- | -`(require 'tree)' +`(require 'tree)' 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 equ? | + -- Function: subst new old tree | + -- Function: substq new old tree | + -- Function: substv new old tree | + -- Function: subst new old tree equ? | `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 @@ -12316,7 +13086,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. @@ -12331,17 +13101,17 @@ Tree operations File: slib.info, Node: Chapter Ordering, Next: Sorting, Prev: Tree Operations, Up: Sorting and Searching -Chapter Ordering ----------------- +7.2.3 Chapter Ordering | +---------------------- | -`(require 'chapter-order)' +`(require 'chapter-order)' The `chap:' functions deal with strings which are ordered like 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<?' @@ -12351,12 +13121,12 @@ 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 + -- 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 @@ -12370,10 +13140,10 @@ like case. File: slib.info, Node: Sorting, Next: Topological Sort, Prev: Chapter Ordering, Up: Sorting and Searching -Sorting -------- +7.2.4 Sorting | +------------- | -`(require 'sort)' +`(require 'sort)' Many Scheme systems provide some kind of sorting functions. They do not, however, always provide the _same_ sorting functions, and those @@ -12387,14 +13157,11 @@ Dybvig says that Chez Scheme provides (merge! predicate list1 list2) (sort predicate list) (sort! predicate list) - -while MIT Scheme 7.1, following Common LISP, offers unstable + while MIT Scheme 7.1, following Common LISP, offers unstable (sort list predicate) - -TI PC Scheme offers + TI PC Scheme offers (sort! list/vector predicate?) - -and Elk offers + and Elk offers (sort list/vector predicate?) (sort! list/vector predicate?) @@ -12457,16 +13224,16 @@ arguments which acts like `<'. For example, are suitable for use as comparison functions. Think of `(less? x 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)'). Returns `#f' when the sequence contains at least one out-of-order - pair. It is an error if the sequence is not a list, vector, or | - string. | + pair. It is an error if the sequence is not a list, vector, or + string. - - 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 @@ -12475,7 +13242,7 @@ as saying when `x' must _not_ precede `y'. bit of work anyway. I did, however, appeal to CL to determine the _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 @@ -12488,23 +13255,22 @@ as saying when `x' must _not_ precede `y'. per iteration.) - - Function: sort sequence less? - Accepts either a list, vector, or string; 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. | + -- Function: sort sequence less? | + Accepts either a list, vector, or string; 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. - - 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 or string, the sorted elements are | - put back in the same vector or string. | + original sequence is a vector or string, the sorted elements are + put back in the same vector or string. Some people have been confused about how to use `sort!', thinking that it doesn't return a value. It needs to be pointed out that (set! slist (sort! slist <)) - is the proper usage, not (sort! slist <) @@ -12513,28 +13279,25 @@ A simple device for obtaining the same expressiveness is to define (define (keyed less? key) (lambda (x y) (less? (key x) (key y)))) - -and then, when you would have written + and then, when you would have written (sort a-sequence #'my-less :key #'my-key) - -in Common LISP, just write + in Common LISP, just write (sort! a-sequence (keyed my-less? my-key)) - -in Scheme. + in Scheme. File: slib.info, Node: Topological Sort, Next: Hashing, Prev: Sorting, Up: Sorting and Searching -Topological Sort ----------------- +7.2.5 Topological Sort | +---------------------- | -`(require 'topological-sort)' or `(require 'tsort)' +`(require 'topological-sort)' or `(require 'tsort)' 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. @@ -12576,17 +13339,17 @@ The algorithm is inspired by Cormen, Leiserson and Rivest (1990) File: slib.info, Node: Hashing, Next: Space-Filling Curves, Prev: Topological Sort, Up: Sorting and Searching -Hashing -------- +7.2.6 Hashing | +------------- | -`(require 'hash)' +`(require 'hash)' 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. @@ -12607,54 +13370,159 @@ Hash tables use these functions. File: slib.info, Node: Space-Filling Curves, Next: Soundex, Prev: Hashing, Up: Sorting and Searching -Space-Filling Curves --------------------- +7.2.7 Space-Filling Curves | +-------------------------- | * Menu: -* Peano-Hilbert Space-Filling Curve:: +* Hilbert Space-Filling Curve:: Non-negative coordinates | +* Peano Space-Filling Curve:: Integer coordinates | * Sierpinski Curve:: -File: slib.info, Node: Peano-Hilbert Space-Filling Curve, Next: Sierpinski Curve, Prev: Space-Filling Curves, Up: Space-Filling Curves - -Peano-Hilbert Space-Filling Curve -................................. +File: slib.info, Node: Hilbert Space-Filling Curve, Next: Peano Space-Filling Curve, Prev: Space-Filling Curves, Up: Space-Filling Curves + | +7.2.7.1 Hilbert Space-Filling Curve | +................................... | -`(require 'hilbert-fill)' +`(require 'hilbert-fill)' -The "Peano-Hilbert Space-Filling Curve" is a one-to-one mapping between -a unit line segment and an N-dimensional unit cube. +The "Hilbert Space-Filling Curve" is a one-to-one mapping between a | +unit line segment and an N-dimensional unit cube. This implementation | +treats the nonnegative integers either as fractional bits of a given | +width or as nonnegative integers. | The integer procedures map the non-negative integers to an arbitrarily large N-dimensional cube with its corner at the origin and all coordinates are non-negative. -For any exact nonnegative integers SCALAR and RANK, +For any exact nonnegative integer SCALAR and exact integer RANK > 2, | (= SCALAR (hilbert-coordinates->integer (integer->hilbert-coordinates SCALAR RANK))) => #t - - Function: integer->hilbert-coordinates scalar rank + When treating integers as K fractional bits, | + | + (= SCALAR (hilbert-coordinates->integer | + (integer->hilbert-coordinates SCALAR RANK K)) K) | + => #t | + | + -- Function: integer->hilbert-coordinates scalar rank | Returns a list of RANK integer coordinates corresponding to exact non-negative integer SCALAR. The lists returned by `integer->hilbert-coordinates' for SCALAR arguments 0 and 1 will differ in the first element. - - Function: hilbert-coordinates->integer coords + -- Function: integer->hilbert-coordinates scalar rank k | + SCALAR must be a nonnegative integer of no more than `RANK*K' bits. | + | + `integer->hilbert-coordinates' Returns a list of RANK K-bit | + nonnegative integer coordinates corresponding to exact | + non-negative integer SCALAR. The curves generated by | + `integer->hilbert-coordinates' have the same alignment independent | + of K. | + | + -- Function: hilbert-coordinates->integer coords | + -- Function: hilbert-coordinates->integer coords k | Returns an exact non-negative integer corresponding to COORDS, a list of non-negative integer coordinates. +7.2.7.2 Gray code | +................. | + | +A "Gray code" is an ordering of non-negative integers in which exactly | +one bit differs between each pair of successive elements. There are | +multiple Gray codings. An n-bit Gray code corresponds to a Hamiltonian | +cycle on an n-dimensional hypercube. | + | +Gray codes find use communicating incrementally changing values between | +asynchronous agents. De-laminated Gray codes comprise the coordinates | +of Hilbert space-filling curves. | + | + -- Function: integer->gray-code k | + Converts K to a Gray code of the same `integer-length' as K. | + | + -- Function: gray-code->integer k | + Converts the Gray code K to an integer of the same | + `integer-length' as K. | + | + For any non-negative integer K, | + (eqv? k (gray-code->integer (integer->gray-code k))) | + | + -- Function: = k1 k2 | + -- Function: gray-code<? k1 k2 | + -- Function: gray-code>? k1 k2 | + -- Function: gray-code<=? k1 k2 | + -- Function: gray-code>=? k1 k2 | + These procedures return #t if their Gray code arguments are | + (respectively): equal, monotonically increasing, monotonically | + decreasing, monotonically nondecreasing, or monotonically | + nonincreasing. | + | + For any non-negative integers K1 and K2, the Gray code predicate | + of `(integer->gray-code k1)' and `(integer->gray-code k2)' will | + return the same value as the corresponding predicate of K1 and K2. | + | +7.2.7.3 Bitwise Lamination | +.......................... | + | + -- Function: bitwise-laminate k1 ... | + -- Function: bitwise-delaminate count k | + Returns an integer composed of the bits of K1 ... interlaced in | + argument order. Given K1, ... KN, the n low-order bits of the | + returned value will be the lowest-order bit of each argument. | + | + -- Function: bitwise-laminate count k | + Returns a list of COUNT integers comprised of every COUNTh bit of | + the integer K. | + | + (map (lambda (k) (number->string k 2)) | + (bitwise-delaminate 4 #x7654)) | + => ("0" "1111" "1100" "1010") | + (number->string (bitwise-laminate 0 #b1111 #b1100 #b1010) 16) | + => "7654" | + | + For any non-negative integers K and COUNT: | + (eqv? k (bitwise-laminate (bitwise-delaminate count k))) | + | + -- Function: delaminate-list count ks | + Returns a list of COUNT integers comprised of the Jth bit of the | + integers KS where J ranges from COUNT-1 to 0. | + | + (map (lambda (k) (number->string k 2)) | + (delaminate-list 4 '(7 6 5 4 0 0 0 0))) | + => ("0" "11110000" "11000000" "10100000") | + | + `delaminate-list' is its own inverse: | + (delaminate-list 8 (delaminate-list 4 '(7 6 5 4 0 0 0 0))) | + => (7 6 5 4 0 0 0 0) | + | -File: slib.info, Node: Sierpinski Curve, Prev: Peano-Hilbert Space-Filling Curve, Up: Space-Filling Curves - -Sierpinski Curve -................ +File: slib.info, Node: Peano Space-Filling Curve, Next: Sierpinski Curve, Prev: Hilbert Space-Filling Curve, Up: Space-Filling Curves + | +7.2.7.4 Peano Space-Filling Curve | +................................. | + | + -- Function: integer->peano-coordinates scalar rank | + Returns a list of RANK nonnegative integer coordinates | + corresponding to exact nonnegative integer SCALAR. The lists | + returned by `integer->peano-coordinates' for SCALAR arguments 0 | + and 1 will differ in the first element. | + | + -- Function: peano-coordinates->integer coords | + Returns an exact nonnegative integer corresponding to COORDS, a | + list of nonnegative integer coordinates. | + | + +File: slib.info, Node: Sierpinski Curve, Prev: Peano Space-Filling Curve, Up: Space-Filling Curves + | +7.2.7.5 Sierpinski Curve | +........................ | -`(require 'sierpinski)' +`(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. @@ -12701,12 +13569,12 @@ Sierpinski Curve File: slib.info, Node: Soundex, Next: String Search, Prev: Space-Filling Curves, Up: Sorting and Searching -Soundex -------- +7.2.8 Soundex | +------------- | -`(require 'soundex)' +`(require 'soundex)' - - Function: soundex name + -- 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 @@ -12729,7 +13597,7 @@ Soundex (map soundex '("Euler" "Gauss" "Hilbert" "Knuth" "Lloyd" "Lukasiewicz")) => ("E460" "G200" "H416" "K530" "L300" "L222") - + (map soundex '("Ellery" "Ghosh" "Heilbronn" "Kant" "Ladd" "Lissajous")) => ("E460" "G200" "H416" "K530" "L300" "L222") @@ -12737,31 +13605,31 @@ Soundex Some cases in which the algorithm fails (Knuth): (map soundex '("Rogers" "Rodgers")) => ("R262" "R326") - + (map soundex '("Sinclair" "St. Clair")) => ("S524" "S324") - + (map soundex '("Tchebysheff" "Chebyshev")) => ("T212" "C121") File: slib.info, Node: String Search, Next: Sequence Comparison, Prev: Soundex, Up: Sorting and Searching -String Search -------------- +7.2.9 String Search | +------------------- | -`(require '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 @@ -12771,18 +13639,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. @@ -12797,47 +13665,48 @@ String Search 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; then OLD2 replaced with NEW2 .... Matches are found from the left. Matches do not overlap. - - Function: count-newlines str | + -- Function: count-newlines str | Returns the number of `#\newline' characters in string STR. File: slib.info, Node: Sequence Comparison, Prev: String Search, Up: Sorting and Searching -Sequence Comparison -------------------- +7.2.10 Sequence Comparison | +-------------------------- | -`(require 'diff)' +`(require 'diff)' `diff:edit-length' 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> + `http://www.cs.arizona.edu/people/gene/PAPERS/np_diff.ps' | The values returned by `diff:edit-length' can be used to gauge the degree of match between two sequences. -Surprisingly, "An O(NP) Sequence Comparison Algorithm" does not derive -the edit sequence; only the sequence length. Developing this | -linear-space sub-quadratic-time algorithm for computing the edit | -sequence required hundreds of hours of work. I have submitted a paper | -describing the algorithm to the Journal of Computational Biology. | +`diff:edits' and `diff:longest-common-subsequence' combine the | +algorithm with the divide-and-conquer method outlined in: | + | + E. Myers and W. Miller, | + "Optimal alignments in linear space", | + Computer Application in the Biosciences (CABIOS), 4(1):11-17, 1988. | + `http://www.cs.arizona.edu/people/gene/PAPERS/linear.ps' | 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. +known "spiff" program. - - Function: diff:longest-common-subsequence array1 array2 =? p-lim - - Function: diff:longest-common-subsequence array1 array2 =? - ARRAY1 and ARRAY2 are one-dimensional arrays. The procedure =? is - used to compare sequence tokens for equality. + -- Function: diff:longest-common-subsequence array1 array2 p-lim | + -- Function: diff:longest-common-subsequence array1 array2 | + ARRAY1 and ARRAY2 are one-dimensional arrays. | The non-negative integer P-LIM, if provided, is maximum number of deletions of the shorter sequence to allow. @@ -12848,10 +13717,9 @@ known "spiff" program. of length `(quotient (- (+ len1 len2) (diff:edit-length ARRAY1 ARRAY2)) 2)' holding the longest sequence common to both ARRAYs. - - Function: diff:edits array1 array2 =? p-lim - - Function: diff:edits array1 array2 =? - ARRAY1 and ARRAY2 are one-dimensional arrays. The procedure =? is - used to compare sequence tokens for equality. + -- Function: diff:edits array1 array2 p-lim | + -- Function: diff:edits array1 array2 | + ARRAY1 and ARRAY2 are one-dimensional arrays. | The non-negative integer P-LIM, if provided, is maximum number of deletions of the shorter sequence to allow. `diff:edits' will @@ -12868,10 +13736,9 @@ known "spiff" program. K < 0 Deletes `(array-ref ARRAY2 (- -1 K))' from the sequence. - - Function: diff:edit-length array1 array2 =? p-lim - - Function: diff:edit-length array1 array2 =? - ARRAY1 and ARRAY2 are one-dimensional arrays. The procedure =? is - used to compare sequence tokens for equality. + -- Function: diff:edit-length array1 array2 p-lim | + -- Function: diff:edit-length array1 array2 | + ARRAY1 and ARRAY2 are one-dimensional arrays. | The non-negative integer P-LIM, if provided, is maximum number of deletions of the shorter sequence to allow. `diff:edit-length' @@ -12880,21 +13747,21 @@ known "spiff" program. `diff:edit-length' returns the length of the shortest sequence of edits transformaing ARRAY1 to ARRAY2. - (diff:longest-common-subsequence "fghiejcklm" "fgehijkpqrlm" eqv?) + (diff:longest-common-subsequence "fghiejcklm" "fgehijkpqrlm") | => "fghijklm" - - (diff:edit-length "fghiejcklm" "fgehijkpqrlm" eqv?) + + (diff:edit-length "fghiejcklm" "fgehijkpqrlm") | => 6 - - (diff:edits "fghiejcklm" "fgehijkpqrlm" eqv?) - => #As32(3 -5 -7 8 9 10) + + (diff:edits "fghiejcklm" "fgehijkpqrlm") | + => #A:fixZ32b(3 -5 -7 8 9 10) | ; e c h p q r File: slib.info, Node: Procedures, Next: Standards Support, Prev: Sorting and Searching, Up: Other Packages -Procedures -========== +7.3 Procedures | +============== | Anything that doesn't fall neatly into any of the other categories winds up here. @@ -12911,15 +13778,15 @@ up here. File: slib.info, Node: Type Coercion, Next: String-Case, Prev: Procedures, Up: Procedures -Type Coercion -------------- +7.3.1 Type Coercion | +------------------- | -`(require 'coerce)' +`(require 'coerce)' - - Function: type-of obj + -- Function: type-of obj | Returns a symbol name for the type of OBJ. - - Function: coerce obj result-type + -- 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). @@ -12927,33 +13794,33 @@ Type Coercion File: slib.info, Node: String-Case, Next: String Ports, Prev: Type Coercion, Up: Procedures -String-Case ------------ +7.3.2 String-Case | +----------------- | -`(require 'string-case)' +`(require 'string-case)' - - Procedure: string-upcase str - - Procedure: string-downcase str - - Procedure: string-capitalize str + -- 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-capitalize! str | + -- Function: string-upcase! str | + -- Function: string-downcase! str | + -- Function: string-capitalize! str | The destructive versions of the functions above. - - Function: string-ci->symbol str + -- 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 ... + -- 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). - - Function: StudlyCapsExpand str delimiter - - Function: StudlyCapsExpand str + -- Function: StudlyCapsExpand str delimiter | + -- Function: StudlyCapsExpand str | DELIMITER must be a string or character. If absent, DELIMITER defaults to `-'. `StudlyCapsExpand' returns a copy of STR where DELIMITER is inserted between each lower-case character @@ -12975,18 +13842,18 @@ String-Case File: slib.info, Node: String Ports, Next: Line I/O, Prev: String-Case, Up: Procedures -String Ports ------------- +7.3.3 String Ports | +------------------ | -`(require 'string-port)' +`(require 'string-port)' - - Procedure: call-with-output-string proc + -- 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 + -- 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 @@ -12995,13 +13862,13 @@ String Ports File: slib.info, Node: Line I/O, Next: Multi-Processing, Prev: String Ports, Up: Procedures -Line I/O --------- +7.3.4 Line I/O | +-------------- | -`(require 'line-i/o)' +`(require 'line-i/o)' - - Function: read-line - - Function: read-line port + -- Function: read-line | + -- 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 @@ -13009,8 +13876,8 @@ Line I/O which case it defaults to the value returned by `current-input-port'. - - Procedure: read-line! string | - - Procedure: read-line! string port | + -- Procedure: read-line! string | + -- Procedure: 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 @@ -13020,44 +13887,44 @@ 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 omitted, in which case it defaults to the value returned by `current-input-port'. - - Function: system->line command tmp | - - Function: system->line command | - COMMAND must be a string. The string TMP, if supplied, is a path | - to use as a temporary file. `system->line' calls `system' with | - COMMAND as argument, redirecting stdout to file TMP. | - `system->line' returns a string containing the first line of | - output from TMP. | + -- Function: system->line command tmp | + -- Function: system->line command | + COMMAND must be a string. The string TMP, if supplied, is a path + to use as a temporary file. `system->line' calls `system' with + COMMAND as argument, redirecting stdout to file TMP. + `system->line' returns a string containing the first line of + output from TMP. File: slib.info, Node: Multi-Processing, Next: Metric Units, Prev: Line I/O, Up: Procedures -Multi-Processing ----------------- +7.3.5 Multi-Processing | +---------------------- | -`(require 'process)' +`(require 'process)' This module implements asynchronous (non-polled) time-sliced 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 ignored. If PROC returns, the process is killed. - - Procedure: process:schedule! + -- Procedure: process:schedule! | Saves the current process on `process:queue' and runs the next process from `process:queue'. The value returned is unspecified. - - Procedure: kill-process! + -- 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::). @@ -13065,12 +13932,12 @@ implementation, consider it an example of writing schedulers in Scheme. File: slib.info, Node: Metric Units, Prev: Multi-Processing, Up: Procedures -Metric Units ------------- +7.3.6 Metric Units | +------------------ | -`(require 'metric-units)' +`(require 'metric-units)' - <http://swissnet.ai.mit.edu/~jaffer/MIXF.html> + `http://swiss.csail.mit.edu/~jaffer/MIXF' | "Metric Interchange Format" is a character string encoding for numerical values and units which: @@ -13132,8 +13999,8 @@ used with the unit symbols t (metric ton), r (revolution), or Bd (baud). Exponents may be positive or negative. Fractional exponents must be parenthesized. -SI Prefixes -........... +7.3.6.1 SI Prefixes | +................... | Factor Name Symbol | Factor Name Symbol ====== ==== ====== | ====== ==== ====== @@ -13148,8 +14015,8 @@ SI Prefixes 1e2 hecto h | 1e-21 zepto z 1e1 deka da | 1e-24 yocto y -Binary Prefixes -............... +7.3.6.2 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 @@ -13164,8 +14031,8 @@ multiple (not submultiple) prefixes can also be used with B (byte). 1.048576e6 (2^20) mebi Mi 1.024e3 (2^10) kibi Ki -Unit Symbols -............ +7.3.6.3 Unit Symbols | +.................... | Type of Quantity Name Symbol Equivalent ================ ==== ====== ========== @@ -13221,7 +14088,7 @@ Unit Symbols * db/Np = ln(10) / 20 - - Function: si:conversion-factor to-unit from-unit + -- 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 @@ -13259,8 +14126,8 @@ Unit Symbols File: slib.info, Node: Standards Support, Next: Session Support, Prev: Procedures, Up: Other Packages -Standards Support -================= +7.4 Standards Support | +===================== | * Menu: @@ -13272,7 +14139,7 @@ Standards Support * Multi-argument / and -:: 'multiarg/and- * Multi-argument Apply:: 'multiarg-apply * Rationalize:: 'rationalize -* Promises:: 'delay | +* Promises:: 'delay * Dynamic-Wind:: 'dynamic-wind * Eval:: 'eval * Values:: 'values @@ -13281,19 +14148,19 @@ Standards Support File: slib.info, Node: RnRS, Next: With-File, Prev: Standards Support, Up: Standards Support -RnRS ----- +7.4.1 RnRS | +---------- | The `r2rs', `r3rs', `r4rs', and `r5rs' features attempt to provide procedures and macros to bring a Scheme implementation to the desired version of Scheme. - - Feature: r2rs + -- Feature: r2rs | Requires features implementing procedures and optional procedures specified by `Revised^2 Report on the Algorithmic Language Scheme'; namely `rev3-procedures' and `rev2-procedures'. - - Feature: r3rs + -- Feature: r3rs | Requires features implementing procedures and optional procedures specified by `Revised^3 Report on the Algorithmic Language Scheme'; namely `rev3-procedures'. @@ -13301,12 +14168,12 @@ version of Scheme. _Note:_ SLIB already mandates the `r3rs' procedures which can be portably implemented in `r4rs' implementations. - - Feature: r4rs + -- Feature: r4rs | Requires features implementing procedures and optional procedures specified by `Revised^4 Report on the Algorithmic Language Scheme'; namely `rev4-optional-procedures'. - - Feature: r5rs + -- Feature: r5rs | Requires features implementing procedures and optional procedures specified by `Revised^5 Report on the Algorithmic Language Scheme'; namely `values', `macro', and `eval'. @@ -13314,42 +14181,42 @@ version of Scheme. File: slib.info, Node: With-File, Next: Transcripts, Prev: RnRS, Up: Standards Support -With-File ---------- +7.4.2 With-File | +--------------- | -`(require '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. File: slib.info, Node: Transcripts, Next: Rev2 Procedures, Prev: With-File, Up: Standards Support -Transcripts ------------ +7.4.3 Transcripts | +----------------- | -`(require 'transcript)' +`(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'. File: slib.info, Node: Rev2 Procedures, Next: Rev4 Optional Procedures, Prev: Transcripts, Up: Standards Support -Rev2 Procedures ---------------- +7.4.4 Rev2 Procedures | +--------------------- | -`(require 'rev2-procedures)' +`(require 'rev2-procedures)' The procedures below were specified in the `Revised^2 Report on Scheme'. *N.B.*: The symbols `1+' and `-1+' are not `R4RS' syntax. Scheme->C, for instance, chokes 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 @@ -13365,110 +14232,103 @@ Scheme->C, for instance, chokes 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! pair1 ... + -- 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: <? - - Function: <=? - - Function: =? - - Function: >? - - Function: >=? + -- Function: <? | + -- Function: <=? | + -- Function: =? | + -- Function: >? | + -- Function: >=? | These are equivalent to the procedures of the same name but without the trailing `?'. File: slib.info, Node: Rev4 Optional Procedures, Next: Multi-argument / and -, Prev: Rev2 Procedures, Up: Standards Support -Rev4 Optional Procedures ------------------------- +7.4.5 Rev4 Optional Procedures | +------------------------------ | -`(require 'rev4-optional-procedures)' +`(require 'rev4-optional-procedures)' For the specification of these optional procedures, *Note Standard procedures: (r4rs)Standard procedures. - - Function: list-tail l p - - - Function: string->list s + -- Function: list-tail l p | - - Function: list->string l + -- Function: string-copy | - - Function: string-copy + -- Procedure: string-fill! s obj | - - Procedure: string-fill! s obj - - - Function: list->vector l - - - 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 -Multi-argument / and - ----------------------- +7.4.6 Multi-argument / and - | +---------------------------- | -`(require 'multiarg/and-)' +`(require 'multiarg/and-)' For the specification of these optional forms, *Note Numerical -operations: (r4rs)Numerical operations. | +operations: (r4rs)Numerical operations. - - Function: / dividend divisor1 ... - | - - Function: - minuend subtrahend1 ... + -- Function: / dividend divisor1 ... | + + -- Function: - minuend subtrahend1 ... | File: slib.info, Node: Multi-argument Apply, Next: Rationalize, Prev: Multi-argument / and -, Up: Standards Support -Multi-argument Apply --------------------- +7.4.7 Multi-argument Apply | +-------------------------- | -`(require 'multiarg-apply)' +`(require 'multiarg-apply)' For the specification of this optional form, *Note Control features: (r4rs)Control features. - | - - Function: apply proc arg1 ... + + -- Function: apply proc arg1 ... | File: slib.info, Node: Rationalize, Next: Promises, Prev: Multi-argument Apply, Up: Standards Support -Rationalize ------------ +7.4.8 Rationalize | +----------------- | -`(require 'rationalize)' +`(require 'rationalize)' - - Function: rationalize x e | + -- Function: rationalize x e | 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 e | + -- Function: find-ratio x e | `find-ratio' returns the list of the _simplest_ numerator and - denominator whose quotient differs from X by no more than E. | + denominator whose quotient differs from X by no more than E. (find-ratio 3/97 .0001) => (3 97) (find-ratio 3/97 .001) => (1 32) - - Function: find-ratio-between x y + -- Function: find-ratio-between x y | `find-ratio-between' returns the list of the _simplest_ numerator and denominator between X and Y. @@ -13478,38 +14338,38 @@ of the numerator and denominator. File: slib.info, Node: Promises, Next: Dynamic-Wind, Prev: Rationalize, Up: Standards Support -Promises --------- +7.4.9 Promises | +-------------- | -`(require 'promise)' +`(require 'promise)' - - Function: make-promise proc + -- Function: make-promise proc | + + -- Function: force promise | + + `(require 'delay)' provides `force' and `delay': + + -- Macro: delay obj | + Change occurrences of `(delay EXPRESSION)' to + + (make-promise (lambda () EXPRESSION)) - - Function: force promise | - | - `(require 'delay)' provides `force' and `delay': | - | - - Macro: delay obj | - Change occurrences of `(delay EXPRESSION)' to | - | - (make-promise (lambda () EXPRESSION)) | - | - | - (*note Control features: (r4rs)Control features.). | + + (*note Control features: (r4rs)Control features.). File: slib.info, Node: Dynamic-Wind, Next: Eval, Prev: Promises, Up: Standards Support -Dynamic-Wind ------------- +7.4.10 Dynamic-Wind | +------------------- | -`(require 'dynamic-wind)' +`(require 'dynamic-wind)' This facility is a generalization of Common LISP `unwind-protect', 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). @@ -13530,12 +14390,12 @@ designed to take into account the fact that continuations produced by File: slib.info, Node: Eval, Next: Values, Prev: Dynamic-Wind, Up: Standards Support -Eval ----- +7.4.11 Eval | +----------- | -`(require '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 @@ -13548,15 +14408,15 @@ Eval (eval '(* 7 3) (scheme-report-environment 5)) => 21 - + (let ((f (eval '(lambda (f x) (f x x)) (null-environment)))) (f + 10)) => 20 - - Function: scheme-report-environment version - - Function: null-environment version - - Function: null-environment + -- 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. `Scheme-report-environment' returns a specifier for an environment @@ -13577,7 +14437,7 @@ Eval `scheme-report-environment' may be immutable. - - Function: interaction-environment + -- Function: interaction-environment | This optional procedure returns a specifier for the environment that contains implementation-defined bindings, typically a superset of those listed in the report. The intent is that this @@ -13613,16 +14473,16 @@ Here are some more `eval' examples: File: slib.info, Node: Values, Next: SRFI, Prev: Eval, Up: Standards Support -Values ------- +7.4.12 Values | +------------- | -`(require '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 @@ -13637,13 +14497,13 @@ Values File: slib.info, Node: SRFI, Prev: Values, Up: Standards Support -SRFI ----- +7.4.13 SRFI | +----------- | -`(require 'srfi)' +`(require 'srfi)' Implements "Scheme Request For Implementation" (SRFI) as described at -<http://srfi.schemers.org/> +`http://srfi.schemers.org/' | The Copyright terms of each SRFI states: @@ -13653,7 +14513,7 @@ 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> ... + -- Macro: cond-expand <clause1> <clause2> ... | _Syntax:_ Each <clause> should be of the form (<feature> <expression1> ...) @@ -13669,230 +14529,292 @@ a sample implementation program. an error is signaled. SLIB `cond-expand' is an extension of SRFI-0, - <http://srfi.schemers.org/srfi-0/srfi-0.html>. + `http://srfi.schemers.org/srfi-0/srfi-0.html'. | * Menu: * SRFI-1:: list-processing -* SRFI-2:: guarded LET* special form | -* SRFI-8:: Binding to multiple values | -* SRFI-9:: Defining Record Types | +* SRFI-2:: guarded LET* special form +* SRFI-8:: Binding to multiple values +* SRFI-9:: Defining Record Types + SRFI-47 is the same as *Note Arrays::. | + | File: slib.info, Node: SRFI-1, Next: SRFI-2, Prev: SRFI, Up: SRFI - | -SRFI-1 -...... -`(require 'srfi-1)' +7.4.13.1 SRFI-1 | +............... | + +`(require 'srfi-1)' Implements the "SRFI-1" "list-processing library" as described at -<http://srfi.schemers.org/srfi-1/srfi-1.html> +`http://srfi.schemers.org/srfi-1/srfi-1.html' | Constructors ------------ - - Function: xcons d a + -- Function: xcons d a | `(define (xcons d a) (cons a d))'. - - Function: list-tabulate len proc + -- 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: cons* obj1 obj2 | - - Function: list-copy flist | - | - - Function: iota count start step - - Function: iota count start - - Function: iota count + -- Function: list-copy flist | + + -- 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 ... + -- Function: circular-list obj1 obj2 ... | Returns a circular list of OBJ1, OBJ2, .... Predicates ---------- - - Function: proper-list? obj + -- Function: proper-list? obj | - - Function: circular-list? x + -- Function: circular-list? x | - - Function: dotted-list? obj + -- Function: dotted-list? obj | - - Function: null-list? obj + -- Function: null-list? obj | - - Function: not-pair? obj + -- Function: not-pair? obj | - - Function: list= =pred list ... + -- Function: list= =pred list ... | Selectors --------- - - Function: first pair - | - - Function: second pair | - | - - Function: third pair | - | - - Function: fourth pair | - | - - Function: fifth pair | - - Function: sixth obj - - Function: seventh obj - - Function: eighth obj - - Function: ninth obj - - Function: tenth obj + -- Function: first pair | - - Function: car+cdr pair - | - - Function: drop lst k - - Function: take lst k | - | - - Procedure: take! lst k | + -- Function: second pair | - - Function: take-right lst k + -- Function: third pair | - - Function: drop-right lst k | - | - - Procedure: drop-right! lst k | - | - - Function: split-at lst k + -- Function: fourth pair | - - Procedure: split-at! lst k | - | - - Function: last lst - (car (last-pair lst)) + -- Function: fifth pair | + -- Function: sixth pair | + -- Function: seventh pair | + -- Function: eighth pair | + -- Function: ninth pair | + -- Function: tenth pair | + + -- Function: car+cdr pair | + + -- Function: drop lst k | + -- Function: take lst k | + -- Function: take! lst k | + + -- Function: take-right lst k | + + -- Function: drop-right lst k | + + -- Procedure: drop-right! lst k | + + -- Function: split-at lst k | + -- Function: split-at! lst k | + + -- Function: last lst k ... | Miscellaneous ------------- - - Function: length+ obj + -- Function: length+ clist | - - Function: concatenate lists - - Function: concatenate! lists + -- Function: concatenate lists | + -- Function: concatenate! lists | - - Procedure: reverse! lst | + -- Procedure: reverse! lst | - - Function: append-reverse rev-head tail - - Function: append-reverse! rev-head tail + -- Function: append-reverse rev-head tail | + -- Function: append-reverse! rev-head tail | - - Function: zip list1 list2 ... + -- Function: zip list1 list2 ... | - - Function: unzip1 lst - - Function: unzip2 lst - - Function: unzip3 lst - - Function: unzip4 lst - - Function: unzip5 lst + -- Function: unzip1 lst | + -- Function: unzip2 lst | + -- Function: unzip3 lst | + -- Function: unzip4 lst | + -- Function: unzip5 lst | - - Function: count pred list1 list2 ... + -- Function: count pred list1 list2 ... | Fold and Unfold --------------- - - Procedure: map! f list1 clist2 ... | + -- Function: fold kons knil clist1 clist2 ... | + + -- Function: fold-right kons knil clist1 clist2 ... | + | + -- Function: pair-fold kons knil clist1 clist2 ... | + | + -- Function: pair-fold-right kons knil clist1 clist2 ... | | - - Function: pair-for-each f clist1 clist2 ... | + -- Function: reduce f ridentity list | + -- Function: reduce-right f ridentity list | | + -- Procedure: map! f clist1 clist2 ... | + | + -- Function: pair-for-each f clist1 clist2 ... | + Filtering and Partitioning -------------------------- - - Function: filter pred lis | + -- Function: filter pred list | + + -- Procedure: filter! pred list | + + -- Function: partition pred list | | - - Procedure: filter! pred l | + -- Function: remove pred list | | - - Function: partition pred list | + -- Procedure: partition! pred list | | + -- Procedure: remove! pred list | + Searching --------- - - Function: find pred list + -- Function: find pred clist | - - Function: find-tail pred list + -- Function: find-tail pred clist | - - Function: remove pred l | - | - - Procedure: remove! pred l | - | - - Function: any pred clist1 clist2 ... | - | - - Function: list-index pred clist1 clist2 ... | - | - - Function: span pred list | + -- Function: span pred list | + + -- Procedure: span! pred list | + + -- Function: break pred list | + + -- Procedure: break! pred list | + + -- Function: any pred clist1 clist2 ... | + + -- Function: list-index pred clist1 clist2 ... | | - - 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. + -- Function: member obj list = | + -- Function: member obj list | Deleting -------- + -- Function: delete-duplicates x list = | + -- Function: delete-duplicates x list | + | + -- Procedure: delete-duplicates! x list = | + -- Procedure: delete-duplicates! x list | + | 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. + -- Function: assoc obj alist pred | + -- Function: assoc obj alist | + | + -- Function: alist-cons key datum alist | + | + -- Function: alist-copy alist | + | + -- Function: alist-delete key alist = | + -- Function: alist-delete key alist | + | + -- Procedure: alist-delete! key alist = | + -- Procedure: alist-delete! key alist | Set operations -------------- - -File: slib.info, Node: SRFI-2, Next: SRFI-8, Prev: SRFI-1, Up: SRFI + -- Function: lset<= = list1 ... | + Determine if a transitive subset relation exists between the | + lists LIST1 ..., using = to determine equality of list members. | | -SRFI-2 | -...... | + -- Function: lset= = list1 list2 ... | | -`(require 'srfi-2)' | + -- Function: lset-adjoin list elt1 ... | | - - Macro: and-let* claws body ... | - <http://srfi.schemers.org/srfi-2/srfi-2.html> | + -- Function: lset-union = list1 ... | | - -File: slib.info, Node: SRFI-8, Next: SRFI-9, Prev: SRFI-2, Up: SRFI + -- Function: lset-intersection = list1 list2 ... | | -SRFI-8 | -...... | + -- Function: lset-difference = list1 list2 ... | | -`(require 'srfi-8)' | + -- Function: lset-xor = list1 ... | | - - Special Form: receive formals expression body ... | - <http://srfi.schemers.org/srfi-8/srfi-8.html> | + -- Function: lset-diff+intersection = list1 list2 ... | | - -File: slib.info, Node: SRFI-9, Prev: SRFI-8, Up: SRFI +These are linear-update variants. They are allowed, but not required, | +to use the cons cells in their first list parameter to construct their | +answer. `lset-union!' is permitted to recycle cons cells from any of | +its list arguments. | | -SRFI-9 | -...... | + -- Procedure: lset-intersection! = list1 list2 ... | | -`(require 'srfi-9)' | + -- Procedure: lset-difference! = list1 list2 ... | | - <http://srfi.schemers.org/srfi-9/srfi-9.html> | + -- Procedure: lset-union! = list1 ... | | - - Special Form: define-record-type <type-name> (<constructor-name> | - <field-tag> ...) <predicate-name> <field spec> ... | - Where | - <field-spec> == (<field-tag> <accessor-name>) | - == (<field-tag> <accessor-name> <modifier-name>) | + -- Procedure: lset-xor! = list1 ... | | - `define-record-type' is a syntax wrapper for the SLIB `record' | - module. | + -- Procedure: lset-diff+intersection! = list1 list2 ... | | +File: slib.info, Node: SRFI-2, Next: SRFI-8, Prev: SRFI-1, Up: SRFI + +7.4.13.2 SRFI-2 | +............... | + +`(require 'srfi-2)' + + -- Macro: and-let* claws body ... | + `http://srfi.schemers.org/srfi-2/srfi-2.html' | + + +File: slib.info, Node: SRFI-8, Next: SRFI-9, Prev: SRFI-2, Up: SRFI + +7.4.13.3 SRFI-8 | +............... | + +`(require 'srfi-8)' + + -- Special Form: receive formals expression body ... | + `http://srfi.schemers.org/srfi-8/srfi-8.html' | + + +File: slib.info, Node: SRFI-9, Prev: SRFI-8, Up: SRFI + +7.4.13.4 SRFI-9 | +............... | + +`(require 'srfi-9)' + + `http://srfi.schemers.org/srfi-9/srfi-9.html' | + + -- Special Form: define-record-type <type-name> (<constructor-name> | + <field-tag> ...) <predicate-name> <field spec> ... + Where + <field-spec> == (<field-tag> <accessor-name>) + == (<field-tag> <accessor-name> <modifier-name>) + + `define-record-type' is a syntax wrapper for the SLIB `record' + module. + + File: slib.info, Node: Session Support, Next: System Interface, Prev: Standards Support, Up: Other Packages + +7.5 Session Support | +=================== | + | +If `(provided? 'abort)': | | -Session Support -=============== + -- Function: abort | + Resumes the top level Read-Eval-Print loop. If provided, `abort' | + is used by the `break' and `debug' packages. | * Menu: @@ -13905,20 +14827,20 @@ Session Support File: slib.info, Node: Repl, Next: Quick Print, Prev: Session Support, Up: Session Support -Repl ----- +7.5.1 Repl | +---------- | -`(require 'repl)' +`(require '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', and `repl:quit' dynamically bound during `repl:top-level'. - - Procedure: repl:quit + -- Procedure: repl:quit | Exits from the invocation of `repl:top-level'. The `repl:' procedures establish, as much as is possible to do @@ -13940,10 +14862,10 @@ catching lines and the following lines to your Scheme init file: File: slib.info, Node: Quick Print, Next: Debug, Prev: Repl, Up: Session Support -Quick Print ------------ +7.5.2 Quick Print | +----------------- | -`(require 'qp)' +`(require 'qp)' When displaying error messages and warnings, it is paramount that the output generated for circular lists and large data structures be @@ -13955,16 +14877,16 @@ much improved. variables `*print-level*' and `*print-level*' are set, huge 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. `qpn' is like `qp' but outputs a newline before returning. `qpr' is like `qpn' except that it returns its last argument. - - Variable: *qp-width* + -- Variable: *qp-width* | *QP-WIDTH* is the largest number of characters that `qp' should use. If *QP-WIDTH* is #f, then all items will be `write'n. If *QP-WIDTH* is 0, then all items except procedures will be @@ -13973,10 +14895,10 @@ much improved. File: slib.info, Node: Debug, Next: Breakpoints, Prev: Quick Print, Up: Session Support -Debug ------ +7.5.3 Debug | +----------- | -`(require 'debug)' +`(require 'debug)' Requiring `debug' automatically requires `trace' and `break'. @@ -13986,94 +14908,92 @@ printer for `qp'. This example shows how to do this: (define qpn (lambda args) ...) (provide 'qp) (require 'debug) - - - Procedure: trace-all file ... + + | + -- Procedure: trace-all file ... | Traces (*note Trace::) all procedures `define'd at top-level in `file' .... - - Procedure: track-all file ... + -- Procedure: track-all file ... | Tracks (*note Trace::) all procedures `define'd at top-level in `file' .... - - Procedure: stack-all file ... + -- Procedure: stack-all file ... | Stacks (*note Trace::) all procedures `define'd at top-level in `file' .... - - Procedure: break-all 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 -Breakpoints ------------ +7.5.4 Breakpoints | +----------------- | -`(require 'break)' +`(require 'break)' - - Function: init-debug + -- Function: init-debug | If your Scheme implementation does not support `break' or `abort', a message will appear when you `(require 'break)' or `(require 'debug)' telling you to type `(init-debug)'. This is in order to 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. - - Function: continue + -- Function: continue | 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 .... - - Macro: break + -- Macro: break | With no arguments, makes sure that all the currently broken 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 + -- Macro: unbreak | With no arguments, unbreaks all currently broken identifiers and returns a list of these formerly broken identifiers. 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: breakf proc | + -- Function: breakf proc name | To break, type (set! SYMBOL (breakf SYMBOL)) - or (set! SYMBOL (breakf SYMBOL 'SYMBOL)) - or (define SYMBOL (breakf FUNCTION)) - or (define SYMBOL (breakf FUNCTION 'SYMBOL)) - - Function: unbreakf proc + -- Function: unbreakf proc | To unbreak, type (set! SYMBOL (unbreakf SYMBOL)) File: slib.info, Node: Trace, Prev: Breakpoints, Up: Session Support -Tracing -------- +7.5.5 Tracing | +------------- | -`(require 'trace)' +`(require 'trace)' This feature provides three ways to monitor procedure invocations: @@ -14090,101 +15010,98 @@ trace ...' when the procdure is called; pops and prints `RETN PROCEDURE-NAME VALUE' when the procedure returns. - - Variable: debug:max-count + -- 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 + -- Function: print-call-stack | + -- Function: print-call-stack port | Prints the call-stack to PORT or the current-error-port. - - Macro: trace proc1 ... + -- Macro: trace proc1 ... | Traces the top-level named procedures given as arguments. - - Macro: trace + -- Macro: trace | With no arguments, makes sure that all the currently traced identifiers are traced (even if those identifiers have been redefined) and returns a list of the traced identifiers. - - Macro: track proc1 ... + -- Macro: track proc1 ... | Traces the top-level named procedures given as arguments. - - Macro: track + -- 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 ... + -- Macro: stack proc1 ... | Traces the top-level named procedures given as arguments. - - Macro: stack + -- 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 ... + -- Macro: untrace proc1 ... | Turns tracing, tracking, and off for its arguments. - - Macro: untrace + -- Macro: untrace | With no arguments, untraces all currently traced identifiers and returns a list of these formerly traced identifiers. - - Macro: untrack proc1 ... + -- Macro: untrack proc1 ... | Turns tracing, tracking, and off for its arguments. - - Macro: untrack + -- Macro: untrack | With no arguments, untracks all currently tracked identifiers and returns a list of these formerly tracked identifiers. - - Macro: unstack proc1 ... + -- Macro: unstack proc1 ... | Turns tracing, stacking, and off for its arguments. - - Macro: unstack + -- Macro: unstack | With no arguments, unstacks all currently stacked identifiers and returns a list of these formerly stacked identifiers. 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 - - Function: trackf proc | - - Function: trackf proc name | - - Function: stackf proc | - - Function: stackf proc name | + -- Function: tracef proc | + -- Function: tracef proc name | + -- Function: trackf proc | + -- Function: trackf proc name | + -- Function: stackf proc | + -- Function: stackf proc name | To trace, type (set! SYMBOL (tracef SYMBOL)) - or (set! SYMBOL (tracef SYMBOL 'SYMBOL)) - or (define SYMBOL (tracef FUNCTION)) - or (define SYMBOL (tracef FUNCTION 'SYMBOL)) - - Function: untracef proc + -- Function: untracef proc | Removes tracing, tracking, or stacking for PROC. To untrace, type (set! SYMBOL (untracef SYMBOL)) File: slib.info, Node: System Interface, Next: Extra-SLIB Packages, Prev: Session Support, Up: Other Packages -System Interface -================ +7.6 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. @@ -14197,12 +15114,12 @@ If `(provided? 'system)': File: slib.info, Node: Directories, Next: Transactions, Prev: System Interface, Up: System Interface -Directories ------------ +7.6.1 Directories | +----------------- | -`(require 'directory)' +`(require 'directory)' - - Function: current-directory + -- Function: current-directory | `current-directory' returns a string containing the absolute file name representing the current working directory. If this string cannot be obtained, #f is returned. @@ -14210,22 +15127,22 @@ Directories If `current-directory' cannot be supported by the platform, then #f is returned. - - 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: directory-for-each proc directory + -- Function: directory-for-each proc directory | PROC must be a procedure taking one argument. `Directory-For-Each' applies PROC to the (string) name of each file in DIRECTORY. The dynamic order in which PROC is applied to the filenames is unspecified. The value returned by `directory-for-each' is unspecified. - - Function: directory-for-each proc directory pred + -- Function: directory-for-each proc directory pred | Applies PROC only to those filenames for which the procedure PRED returns a non-false value. - - Function: directory-for-each proc directory match + -- Function: directory-for-each proc directory match | Applies PROC only to those filenames for which `(filename:match?? MATCH)' would return a non-false value (*note Filenames: (slib)Filenames.). @@ -14239,15 +15156,15 @@ Directories File: slib.info, Node: Transactions, Next: CVS, Prev: Directories, Up: System Interface -Transactions ------------- +7.6.2 Transactions | +------------------ | If `system' is provided by the Scheme implementation, the "transact" package provides functions for file-locking and file-replacement transactions. - `(require 'transact)' - | + `(require 'transact)' + File Locking ............ @@ -14268,9 +15185,9 @@ operating system development efforts. There is further irony that both camps support contention detection and resolution only through weak conventions of some their document editing programs. -The "file-lock" procedures implement a transaction method for file -replacement compatible with the methods used by the GNU "emacs" text -editor on Unix systems and the Microsoft "Word" editor. +The "file-lock" procedures implement a transaction method for file replacement +compatible with the methods used by the GNU "emacs" text editor on Unix | +systems and the Microsoft "Word" editor. | Both protocols employ what I term a "certificate" containing the user, hostname, time, and (on Unix) process-id. Intent to replace FILE is @@ -14283,12 +15200,12 @@ link to a certificate named for the visited FILE prefixed with `.#'. Because Unix systems can import Microsoft file systems, these routines maintain and check both Emacs and Word certificates. - - Function: file-lock-owner path + -- Function: file-lock-owner path | Returns the string `USER@HOSTNAME' associated with the lock owner of file PATH if locked; and #f otherwise. - - Procedure: file-lock! path email | - - Procedure: file-lock! path | + -- Procedure: file-lock! path email | + -- Procedure: file-lock! path | PATH must be a string naming the file to be locked. If supplied, EMAIL must be a string formatted as `USER@HOSTNAME'. If absent, EMAIL defaults to the value returned by `user-email-address'. @@ -14297,7 +15214,7 @@ maintain and check both Emacs and Word certificates. PATH is unlocked, then `file-lock!' returns the certificate string associated with the new lock for file PATH. - - Procedure: file-unlock! path certificate | + -- Procedure: file-unlock! path certificate | PATH must be a string naming the file to be unlocked. CERTIFICATE must be the string returned by `file-lock!' for PATH. @@ -14308,7 +15225,7 @@ maintain and check both Emacs and Word certificates. File Transactions ................. - - Function: emacs:backup-name path backup-style + -- Function: emacs:backup-name path backup-style | PATH must be a string. BACKUP-STYLE must be a symbol. Depending on BACKUP-STYLE, `emacs:backup-name' returns: none @@ -14332,10 +15249,10 @@ File Transactions bak the string "PATH.bak" - - Function: transact-file-replacement proc path backup-style + -- Function: transact-file-replacement proc path backup-style | certificate - - Function: transact-file-replacement proc path backup-style - - Function: transact-file-replacement proc path + -- Function: transact-file-replacement proc path backup-style | + -- Function: transact-file-replacement proc path | PATH must be a string naming an existing file. BACKUP-STYLE is one of the symbols none, simple, numbered, existing, orig, bak or #f; with meanings described above; or a string naming the location @@ -14368,7 +15285,7 @@ File Transactions Identification .............. - - Function: user-email-address + -- Function: user-email-address | `user-email-address' returns a string of the form `username@hostname'. If this e-mail address cannot be obtained, #f is returned. @@ -14376,42 +15293,45 @@ Identification File: slib.info, Node: CVS, Prev: Transactions, Up: System Interface -CVS ---- +7.6.3 CVS | +--------- | -`(require 'cvs)' +`(require 'cvs)' - - Function: cvs-files directory/ + -- Function: cvs-files directory/ | Returns a list of the local pathnames (with prefix DIRECTORY/) of all CVS controlled files in DIRECTORY/ and in DIRECTORY/'s subdirectories. - - Function: cvs-directories directory/ + -- Function: cvs-directories directory/ | Returns a list of all of DIRECTORY/ and all DIRECTORY/'s CVS controlled subdirectories. - - Function: cvs-root path/ + -- Function: cvs-root path/ | Returns the (string) contents of PATH/CVS/Root; or `(getenv "CVSROOT")' if Root doesn't exist. - - Function: cvs-repository directory/ + -- Function: cvs-repository directory/ | Returns the (string) contents of DIRECTORY/CVS/Root appended with DIRECTORY/CVS/Repository; or #f if DIRECTORY/CVS/Repository doesn't exist. - - Procedure: cvs-set-root! new-root directory/ | - Writes NEW-ROOT to file CVS/Root of DIRECTORY/ and all its + -- Procedure: cvs-set-root! new-root directory/ | + Writes NEW-ROOT to file CVS/Root of DIRECTORY/. | + | + -- Procedure: cvs-set-roots! new-root directory/ | + Writes NEW-ROOT to file CVS/Root of DIRECTORY/ and all its CVS | subdirectories. - - Function: cvs-vet directory/ + -- Function: cvs-vet directory/ | Signals an error if CVS/Repository or CVS/Root files in DIRECTORY/ or any subdirectory do not match. File: slib.info, Node: Extra-SLIB Packages, Prev: System Interface, Up: Other Packages -Extra-SLIB Packages -=================== +7.7 Extra-SLIB Packages | +======================= | Several Scheme packages have been written using SLIB. There are several reasons why a package might not be included in the SLIB distribution: @@ -14435,9 +15355,9 @@ as easily as any other SLIB package. Some optional packages (for which SLIB-PSD is a portable debugger for Scheme (requires emacs editor). - http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz + http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz | - swissnet.ai.mit.edu:/pub/scm/slib-psd1-3.tar.gz + swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz | ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz @@ -14467,35 +15387,38 @@ JFILTER File: slib.info, Node: About SLIB, Next: Index, Prev: Other Packages, Up: Top -About SLIB -********** +8 About SLIB | +************ | More people than I can name have contributed to SLIB. Thanks to all of you! - SLIB 3a1, released November 2003. | + SLIB 3a2, released June 2005. | Aubrey Jaffer <agj @ alum.mit.edu> Hyperactive Software - The Maniac Inside! - <http://swissnet.ai.mit.edu/~jaffer/SLIB.html> + `http://swiss.csail.mit.edu/~jaffer/SLIB.html' | * Menu: * Installation:: How to install SLIB on your system. +* The SLIB script:: Run interactive SLIB sessions. | * Porting:: SLIB to new platforms. * Coding Guidelines:: How to write modules for SLIB. * Copyrights:: Intellectual propery issues. -* About this manual:: | +* About this manual:: -File: slib.info, Node: Installation, Next: Porting, Prev: About SLIB, Up: About SLIB - -Installation -============ +File: slib.info, Node: Installation, Next: The SLIB script, Prev: About SLIB, Up: About SLIB + | +8.1 Installation | +================ | -There are four parts to installation: +There are five parts to installation: | * Unpack the SLIB distribution. + * Install documentation and `slib' script. | + | * Configure the Scheme implementation(s) to locate the SLIB directory. @@ -14504,8 +15427,8 @@ There are four parts to installation: * Build the SLIB catalog for the Scheme implementation. -Unpacking the SLIB Distribution -------------------------------- +8.1.1 Unpacking the SLIB Distribution | +------------------------------------- | If the SLIB distribution is a Linux RPM, it will create the SLIB directory `/usr/share/slib'. @@ -14518,8 +15441,14 @@ 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 ----------------------------------------------- +8.1.2 Install documentation and slib script | +------------------------------------------- | + | + make infoz | + make install | + | +8.1.3 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 @@ -14531,8 +15460,8 @@ supports `getenv' but does not use it for determining The `(library-vicinity)' can also be specified from the SLIB initialization file or by implementation-specific means. -Loading SLIB Initialization File --------------------------------- +8.1.4 Loading SLIB Initialization File | +-------------------------------------- | Check the manifest in `README' to find a configuration file for your Scheme implementation. Initialization files for most IEEE P1178 @@ -14546,8 +15475,8 @@ the file for how to configure it. Once this is done, modify the startup file for your Scheme implementation to `load' this initialization file. -Build New SLIB Catalog for Implementation ------------------------------------------ +8.1.5 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. @@ -14567,19 +15496,65 @@ SLIB-installed scheme implementation, type: (require 'new-catalog) (slib:exit) -Implementation-specific Instructions ------------------------------------- +8.1.6 Implementation-specific Instructions | +------------------------------------------ | Multiple implementations of Scheme can all use the same SLIB directory. Simply configure each implementation's initialization file as outlined above. - - Implementation: SCM + -- 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 + -- 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 -f ${SCHEME_LIBRARY_PATH}DrScheme.init' | + | + -- Implementation: MIT Scheme | + `scheme -load ${SCHEME_LIBRARY_PATH}mitscheme.init' | + | + -- Implementation: Gambit-C 3.0 | + `$command -:s ${SCHEME_LIBRARY_PATH}gambit.init -' | + | + -- Implementation: Guile | + Guile versions 1.6 and earlier link to an archaic SLIB version. In | + RedHat or Fedora installations: | + | + rm /usr/share/guile/slib | + ln -s ${SCHEME_LIBRARY_PATH} /usr/share/guile/slib | + | + In Debian installations: | + | + rm /usr/share/guile/1.6/slib | + ln -s ${SCHEME_LIBRARY_PATH} /usr/share/guile/1.6/slib | + | + `${SCHEME_LIBRARY_PATH}' is where SLIB gets installed. | + | + Guile with SLIB can then be started thus: | + | + `guile -l ${SCHEME_LIBRARY_PATH}guile.init' | + | + -- 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: VSCM | From: Matthias Blume <blume @ cs.Princeton.EDU> Date: Tue, 1 Mar 1994 11:42:31 -0500 @@ -14603,48 +15578,36 @@ above. Makefile (definition of DDP) for details.) - - 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. + +File: slib.info, Node: The SLIB script, Next: Porting, Prev: Installation, Up: About SLIB + | +8.2 The SLIB script | +=================== | - To use SLIB in MzScheme, set the SCHEME_LIBRARY_PATH environment - variable to the installed SLIB location; then invoke MzScheme thus: +SLIB comes with shell script for Unix platforms. | - `mzscheme -f ${SCHEME_LIBRARY_PATH}DrScheme.init' + slib [ scm | gsi | mzscheme | guile | slib48 | scheme48 | scmlit ] | + | - - Implementation: MIT Scheme - `scheme -load ${SCHEME_LIBRARY_PATH}mitscheme.init' +Starts an interactive Scheme-with-SLIB session. | - - Implementation: Guile - `guile -l ${SCHEME_LIBRARY_PATH}guile.init' +The optional argument to the `slib' script is the Scheme implementation | +to run. Absent the argument, it searches for implementations in the | +above order. | -File: slib.info, Node: Porting, Next: Coding Guidelines, Prev: Installation, Up: About SLIB - -Porting -======= +File: slib.info, Node: Porting, Next: Coding Guidelines, Prev: The SLIB script, Up: About SLIB + | +8.3 Porting | +=========== | If there is no initialization file for your Scheme implementation, you will have to create one. Your Scheme implementation must be largely -compliant with | - `IEEE Std 1178-1990', | - `Revised^4 Report on the Algorithmic Language Scheme', or | - `Revised^5 Report on the Algorithmic Language Scheme' | - | -in order to support SLIB. (1) | +compliant with + `IEEE Std 1178-1990', + `Revised^4 Report on the Algorithmic Language Scheme', or + `Revised^5 Report on the Algorithmic Language Scheme' + in order to support SLIB. (1) `Template.scm' is an example configuration file. The comments inside will direct you on how to customize it to reflect your system. Give @@ -14656,9 +15619,9 @@ initialization file might be called `foo.init'. implementation's initialization. It will load `require.scm' from the library; this will allow the use of `provide', `provided?', and `require' along with the "vicinity" functions (these functions are -documented in the sections *Note Feature:: and *Note Require::). The | -rest of the library will then be accessible in a system independent | -fashion. | +documented in the sections *Note Feature:: and *Note Require::). The +rest of the library will then be accessible in a system independent +fashion. Please mail new working configuration files to `agj @ alum.mit.edu' so that they can be included in the SLIB distribution. @@ -14672,43 +15635,43 @@ Language Scheme' implementation, then you will need to finish writing File: slib.info, Node: Coding Guidelines, Next: Copyrights, Prev: Porting, Up: About SLIB -Coding Guidelines -================= +8.4 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? 'r3rs)' or `(require 'r3rs)' (*note | -Require::). | +by using, for example, `(provided? 'r3rs)' or `(require 'r3rs)' (*note +Require::). - If a procedure defined in a module is called by other procedures in | -that module, then those procedures should instead call an alias defined | -in that module: | + If a procedure defined in a module is called by other procedures in +that module, then those procedures should instead call an alias defined +in that module: - (define module-name:foo foo) | - | - The module name and `:' should prefix that symbol for the internal | -name. Do not export internal aliases. | - | - A procedure is exported from a module by putting Schmooz-style | -comments (*note Schmooz::) or `;@' at the beginning of the line | -immediately preceding the definition (`define', `define-syntax', or | -`defmacro'). Modules, exports and other relevant issues are discussed | -in *Note Compiling Scheme::. | - | - Code submitted for inclusion in SLIB should not duplicate (more than | -one) routines already in SLIB files. Use `require' to force those | -library routines to be used by your package. | + (define module-name:foo foo) + + The module name and `:' should prefix that symbol for the internal +name. Do not export internal aliases. + + A procedure is exported from a module by putting Schmooz-style +comments (*note Schmooz::) or `;@' at the beginning of the line +immediately preceding the definition (`define', `define-syntax', or +`defmacro'). Modules, exports and other relevant issues are discussed +in *Note Compiling Scheme::. + + Code submitted for inclusion in SLIB should not duplicate (more than +one) routines already in SLIB files. Use `require' to force those +library routines to be used by your package. Documentation should be provided in Emacs Texinfo format if possible, -but documentation must be provided. | +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 code! -Modifications -------------- +8.4.1 Modifications | +------------------- | Please document your changes. A line or two for `ChangeLog' is sufficient for simple fixes or extensions. Look at the format of @@ -14730,11 +15693,11 @@ fixes. File: slib.info, Node: Copyrights, Next: About this manual, Prev: Coding Guidelines, Up: About SLIB - | -Copyrights -========== -This section has instructions for SLIB authors regarding copyrights. +8.5 Copyrights | +============== | + +This section has instructions for SLIB authors regarding copyrights. Each package in SLIB must either be in the public domain, or come with a statement of terms permitting users to copy, redistribute and @@ -14744,8 +15707,8 @@ modify it. The comments at the beginning of `require.scm' and If your code or changes amount to less than about 10 lines, you do not need to add your copyright or send a disclaimer. -Putting code into the Public Domain ------------------------------------ +8.5.1 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 agj @ @@ -14772,8 +15735,8 @@ and have your employer sign it. Mail the signed disclaimer to the SLIB maintainer. Contact agj @ alum.mit.edu for the address to mail the disclaimer to. An example disclaimer follows. -Explicit copying terms ----------------------- +8.5.2 Explicit copying terms | +---------------------------- | If you submit more than about 10 lines of code which you are not placing into the Public Domain (by sending me a disclaimer) you need to: @@ -14790,8 +15753,8 @@ placing into the Public Domain (by sending me a disclaimer) you need to: disclaim to the SLIB maintainer. Contact agj @ alum.mit.edu for the address to mail the disclaimer to. -Example: Company Copyright Disclaimer -------------------------------------- +8.5.3 Example: Company Copyright Disclaimer | +------------------------------------------- | This disclaimer should be signed by a vice president or general manager of the company. If you can't get at them, anyone else authorized to @@ -14809,1653 +15772,1950 @@ license out software produced there will do. Here is a sample wording: File: slib.info, Node: About this manual, Prev: Copyrights, Up: About SLIB - | -About this manual | -================= | - | - * Entries that are labeled as Functions are called for their return | - values. Entries that are labeled as Procedures are called | - primarily for their side effects. | - | - * Examples in this text were produced using the `scm' Scheme | - implementation. | - | - * At the beginning of each section, there is a line that looks like | - `(require 'feature)'. Include this line in your code prior to | - using the package. | - | + +8.6 About this manual | +===================== | + + * Entries that are labeled as Functions are called for their return + values. Entries that are labeled as Procedures are called + primarily for their side effects. + + * Examples in this text were produced using the `scm' Scheme + implementation. + + * At the beginning of each section, there is a line that looks like `(require + 'feature)'. Include this line in your code prior to using the | + package. | + File: slib.info, Node: Index, Prev: About SLIB, Up: Top + +Index | +***** | | Procedure and Macro Index ************************* This is an alphabetical list of all the procedures and macros in SLIB. + * Menu: * -: Multi-argument / and -. -* -1+: Rev2 Procedures. + (line 14) | +* -1+: Rev2 Procedures. (line 42) | * /: Multi-argument / and -. -* 1+: Rev2 Procedures. -* <=?: Rev2 Procedures. -* <?: Rev2 Procedures. -* =: Bit-Twiddling. -* =?: Rev2 Procedures. -* >=?: Rev2 Procedures. -* >?: Rev2 Procedures. -* absolute-path?: URI. -* absolute-uri?: URI. -* ac32: Arrays. -* ac64: Arrays. -* add-command-tables: Database Extension. -* add-domain: Using Databases. | -* add-domain on relational-database: Command Intrinsics. | -* add-process!: Multi-Processing. -* add-setter: Setters. -* adjoin: Lists as sets. -* adjoin-parameters!: Parameter lists. | + (line 12) | +* 1+: Rev2 Procedures. (line 39) | +* <=?: Rev2 Procedures. (line 46) | +* <?: Rev2 Procedures. (line 45) | +* =: Hilbert Space-Filling Curve. | + (line 72) | +* =?: Rev2 Procedures. (line 47) | +* >=?: Rev2 Procedures. (line 49) | +* >?: Rev2 Procedures. (line 48) | +* a:bool: Arrays. (line 236) | +* a:fixn16b: Arrays. (line 226) | +* a:fixn32b: Arrays. (line 221) | +* a:fixn64b: Arrays. (line 216) | +* a:fixn8b: Arrays. (line 231) | +* a:fixz16b: Arrays. (line 206) | +* a:fixz32b: Arrays. (line 201) | +* a:fixz64b: Arrays. (line 196) | +* a:fixz8b: Arrays. (line 211) | +* a:floc128b: Arrays. (line 149) | +* a:floc16b: Arrays. (line 161) | +* a:floc32b: Arrays. (line 157) | +* a:floc64b: Arrays. (line 153) | +* a:flor128b: Arrays. (line 165) | +* a:flor16b: Arrays. (line 177) | +* a:flor32b: Arrays. (line 173) | +* a:flor64b: Arrays. (line 169) | +* abort: Session Support. (line 9) | +* absolute-path?: URI. (line 102) | +* absolute-uri?: URI. (line 98) | +* add-command-tables: Database Extension. (line 11) | +* add-domain: Using Databases. (line 131) | +* add-domain on relational-database: Command Intrinsics. (line 10) | +* add-macro-support: Within-database. (line 52) | +* add-process!: Multi-Processing. (line 14) | +* add-setter: Setters. (line 43) | +* adjoin: Lists as sets. (line 10) | +* adjoin-parameters!: Parameter lists. (line 38) | * alist->wt-tree: Construction of Weight-Balanced Trees. -* alist-associator: Association Lists. -* alist-for-each: Association Lists. -* alist-inquirer: Association Lists. -* alist-map: Association Lists. -* alist-remover: Association Lists. -* alist-table: The Base. | -* and-let*: SRFI-2. | -* and?: Non-List functions. -* any: SRFI-1. | -* any?: Collections. -* append!: Rev2 Procedures. -* append-reverse: SRFI-1. -* append-reverse!: SRFI-1. + (line 65) | +* alist-associator: Association Lists. (line 28) | +* alist-cons: SRFI-1. (line 178) | +* alist-copy: SRFI-1. (line 180) | +* alist-delete: SRFI-1. (line 182) | +* alist-delete!: SRFI-1. (line 185) | +* alist-for-each: Association Lists. (line 53) | +* alist-inquirer: Association Lists. (line 23) | +* alist-map: Association Lists. (line 48) | +* alist-remover: Association Lists. (line 39) | +* alist-table: The Base. (line 12) | +* and-let*: SRFI-2. (line 9) | +* and?: Non-List functions. (line 7) | +* any: SRFI-1. (line 156) | +* any-bits-set?: Bit-Twiddling. (line 64) | +* any?: Collections. (line 83) | +* append!: Rev2 Procedures. (line 36) | +* append-reverse: SRFI-1. (line 95) | +* append-reverse!: SRFI-1. (line 96) | * apply: Multi-argument Apply. -* ar32: Arrays. -* ar64: Arrays. -* array-align: Subarrays. -* array-copy!: Array Mapping. -* array-dimensions: Arrays. -* array-for-each: Array Mapping. -* array-in-bounds?: Arrays. -* array-index-map!: Array Mapping. -* array-indexes: Array Mapping. -* array-map: Array Mapping. | -* array-map!: Array Mapping. -* array-rank: Arrays. -* array-ref: Arrays. -* array-set!: Arrays. -* array-shape: Arrays. -* array-trim: Subarrays. -* array=?: Arrays. -* array?: Arrays. -* as16: Arrays. -* as32: Arrays. -* as64: Arrays. -* as8: Arrays. -* asctime: Posix Time. -* ash: Bit-Twiddling. -* assoc: SRFI-1. -* at1: Arrays. -* atom?: Non-List functions. -* au16: Arrays. -* au32: Arrays. -* au64: Arrays. -* au8: Arrays. -* batch:call-with-output-script: 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. | -* bit-field: Bit-Twiddling. -* bit-reverse: Bit-Twiddling. -* bitwise-if: Bit-Twiddling. -* bitwise:delaminate: Bit-Twiddling. -* bitwise:laminate: Bit-Twiddling. -* blackbody-spectrum: Spectra. -* booleans->integer: Bit-Twiddling. -* break: Breakpoints. -* break-all: Debug. -* breakf: Breakpoints. -* breakpoint: Breakpoints. -* browse: Database Browser. -* browse-url: System. -* butlast: Lists as sequences. -* butnthcdr: Lists as sequences. -* byte-ref: Byte. -* byte-set!: Byte. -* bytes: Byte. -* bytes->ieee-double: Byte/Number Conversions. | -* bytes->ieee-float: Byte/Number Conversions. | -* bytes->integer: Byte/Number Conversions. | -* bytes->list: Byte. -* bytes-copy: Byte. | -* bytes-length: Byte. -* bytes-reverse: Byte. | -* bytes-reverse!: Byte. | -* call-with-dynamic-binding: Dynamic Data Type. -* call-with-input-string: String Ports. -* call-with-open-ports: Input/Output. -* call-with-output-string: String Ports. -* call-with-tmpnam: Filenames. | -* call-with-values: Values. -* capture-syntactic-environment: Syntactic Closures. -* car+cdr: SRFI-1. -* cart-prod-tables on relational-database: Database Operations. | -* catalog->html: HTML Tables. -* catalog-id on base-table: Base Tables. | -* catalog:read: Catalog Vicinities. | -* cdna:base-count: NCBI-DNA. -* cdna:report-base-count: NCBI-DNA. -* 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. -* chromaticity->CIEXYZ: Spectra. -* chromaticity->whitepoint: Spectra. + (line 12) | +* arithmetic-shift: Bit-Twiddling. (line 182) | +* array->list: Arrays. (line 101) | +* array->vector: Arrays. (line 124) | +* array-dimensions: Arrays. (line 48) | +* array-for-each: Array Mapping. (line 25) | +* array-in-bounds?: Arrays. (line 133) | +* array-index-map!: Array Mapping. (line 34) | +* array-indexes: Array Mapping. (line 29) | +* array-map: Array Mapping. (line 17) | +* array-map!: Array Mapping. (line 9) | +* array-rank: Arrays. (line 44) | +* array-ref: Arrays. (line 136) | +* array-set!: Arrays. (line 139) | +* array-trim: Subarrays. (line 44) | +* array:copy!: Array Mapping. (line 50) | +* array?: Arrays. (line 9) | +* asctime: Posix Time. (line 62) | +* ash: Bit-Twiddling. (line 181) | +* assoc: SRFI-1. (line 175) | +* atom?: Non-List functions. (line 30) | +* batch:call-with-output-script: Batch. (line 47) | +* batch:command: Batch. (line 64) | +* batch:comment: Batch. (line 95) | +* batch:delete-file: Batch. (line 102) | +* batch:initialize!: Batch. (line 36) | +* batch:lines->file: Batch. (line 98) | +* batch:rename-file: Batch. (line 106) | +* batch:run-script: Batch. (line 88) | +* batch:try-chopped-command: Batch. (line 76) | +* batch:try-command: Batch. (line 72) | +* bit-count: Bit-Twiddling. (line 74) | +* bit-field: Bit-Twiddling. (line 156) | +* bit-set?: Bit-Twiddling. (line 135) | +* bitwise-and: Bit-Twiddling. (line 19) | +* bitwise-delaminate: Hilbert Space-Filling Curve. | + (line 90) | +* bitwise-if: Bit-Twiddling. (line 56) | +* bitwise-ior: Bit-Twiddling. (line 28) | +* bitwise-laminate: Hilbert Space-Filling Curve. | + (line 89) | +* bitwise-merge: Bit-Twiddling. (line 57) | +* bitwise-not: Bit-Twiddling. (line 46) | +* bitwise-xor: Bit-Twiddling. (line 37) | +* blackbody-spectrum: Spectra. (line 125) | +* booleans->integer: Bit-Twiddling. (line 229) | +* break <1>: Breakpoints. (line 28) | +* break: SRFI-1. (line 152) | +* break!: SRFI-1. (line 154) | +* break-all: Debug. (line 31) | +* breakf: Breakpoints. (line 47) | +* breakpoint: Breakpoints. (line 16) | +* browse: Database Browser. (line 9) | +* browse-url: System. (line 60) | +* butlast: Lists as sequences. (line 121) | +* butnthcdr: Lists as sequences. (line 147) | +* byte-ref: Byte. (line 14) | +* byte-set!: Byte. (line 18) | +* bytes: Byte. (line 32) | +* bytes->ieee-double: Byte/Number Conversions. + (line 58) | +* bytes->ieee-float: Byte/Number Conversions. + (line 41) | +* bytes->integer: Byte/Number Conversions. + (line 17) | +* bytes->list: Byte. (line 36) | +* bytes-copy: Byte. (line 47) | +* bytes-length: Byte. (line 29) | +* bytes-reverse: Byte. (line 53) | +* bytes-reverse!: Byte. (line 50) | +* call-with-dynamic-binding: Dynamic Data Type. (line 25) | +* call-with-input-string: String Ports. (line 15) | +* call-with-open-ports: Input/Output. (line 54) | +* call-with-output-string: String Ports. (line 9) | +* call-with-tmpnam: Filenames. (line 74) | +* call-with-values: Values. (line 13) | +* capture-syntactic-environment: Syntactic Closures. (line 211) | +* car+cdr: SRFI-1. (line 68) | +* cart-prod-tables on relational-database: Database Operations. + (line 78) | +* catalog->html: HTML Tables. (line 49) | +* catalog-id on base-table: Base Tables. (line 30) | +* catalog:read: Catalog Vicinities. (line 57) | +* cdna:base-count: NCBI-DNA. (line 35) | +* cdna:report-base-count: NCBI-DNA. (line 39) | +* cgi:serve-query: HTTP and CGI. (line 69) | +* chap:next-string: Chapter Ordering. (line 29) | +* chap:string<=?: Chapter Ordering. (line 25) | +* chap:string<?: Chapter Ordering. (line 14) | +* chap:string>=?: Chapter Ordering. (line 26) | +* chap:string>?: Chapter Ordering. (line 24) | +* check-parameters: Parameter lists. (line 59) | +* chromaticity->CIEXYZ: Spectra. (line 169) | +* chromaticity->whitepoint: Spectra. (line 172) | * CIE:DE*: Color Difference Metrics. + (line 20) | * CIE:DE*94: Color Difference Metrics. -* ciexyz->color: Color Spaces. -* CIEXYZ->e-sRGB: Color Conversions. -* CIEXYZ->L*a*b*: Color Conversions. -* CIEXYZ->L*u*v*: Color Conversions. -* CIEXYZ->RGB709: Color Conversions. -* CIEXYZ->sRGB: Color Conversions. -* CIEXYZ->xRGB: Color Conversions. | -* circular-list: SRFI-1. -* circular-list?: SRFI-1. -* cksum: Cyclic Checksum. | -* clear-sky-color-xyy: Daylight. -* clip-to-rect: Rectangles. | -* close-base on base-table: The Base. | -* close-database: Using Databases. -* close-database on relational-database: Database Operations. | -* close-port: Input/Output. -* close-table on relational-table: Table Administration. | -* CMC-DE: Color Difference Metrics. | + (line 27) | +* ciexyz->color: Color Spaces. (line 25) | +* CIEXYZ->e-sRGB: Color Conversions. (line 56) | +* CIEXYZ->L*a*b*: Color Conversions. (line 38) | +* CIEXYZ->L*u*v*: Color Conversions. (line 32) | +* CIEXYZ->RGB709: Color Conversions. (line 29) | +* CIEXYZ->sRGB: Color Conversions. (line 47) | +* CIEXYZ->xRGB: Color Conversions. (line 50) | +* circular-list: SRFI-1. (line 32) | +* circular-list?: SRFI-1. (line 40) | +* cksum: Cyclic Checksum. (line 149) | +* clear-sky-color-xyy: Daylight. (line 84) | +* clip-to-rect: Rectangles. (line 36) | +* close-base on base-table: The Base. (line 60) | +* close-database: Using Databases. (line 89) | +* close-database on relational-database: Database Operations. (line 20) | +* close-port: Input/Output. (line 47) | +* close-table on relational-table: Table Administration. + (line 20) | +* CMC-DE: Color Difference Metrics. + (line 61) | * CMC:DE*: Color Difference Metrics. -* codons<-cdna: NCBI-DNA. -* coerce: Type Coercion. -* collection?: Collections. -* color->ciexyz: Color Spaces. -* color->e-srgb: Color Spaces. -* color->l*a*b*: Color Spaces. -* color->l*c*h: Color Spaces. -* color->l*u*v*: Color Spaces. -* color->rgb709: Color Spaces. -* color->srgb: Color Spaces. -* color->string: Color Data-Type. -* color->xrgb: Color Spaces. -* color-dictionaries->lookup: Color Names. -* color-dictionary: Color Names. -* color-name->color: Color Names. -* color-name:canonicalize: Color Names. -* color-precision: Color Data-Type. -* color-space: Color Data-Type. -* color-white-point: Color Data-Type. -* color:ciexyz: Color Spaces. -* color:e-srgb: Color Spaces. -* color:l*a*b*: Color Spaces. -* color:l*c*h: Color Spaces. -* color:l*u*v*: Color Spaces. -* color:linear-transform: Color Conversions. | -* color:rgb709: Color Spaces. -* color:srgb: Color Spaces. -* color?: Color Data-Type. -* column-domains on relational-table: Table Administration. | -* column-foreigns on relational-table: Table Administration. | -* column-names on relational-table: Table Administration. | -* column-range: Column Ranges. | -* column-types on relational-table: Table Administration. | -* combine-ranges: Column Ranges. | -* combined-rulesets: Commutative Rings. -* 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. -* convert-color: Color Data-Type. -* copy-bit: Bit-Twiddling. -* copy-bit-field: Bit-Twiddling. -* copy-list: List construction. -* copy-random-state: Exact Random Numbers. | -* copy-tree: Tree Operations. -* count: SRFI-1. -* count-newlines: String Search. | -* crc16: Cyclic Checksum. -* crc5: Cyclic Checksum. -* crc:make-table: Cyclic Checksum. -* create-array: Arrays. | -* create-database: Using Databases. -* create-database on relational-system: Relational Database Objects. | -* create-postscript-graph: PostScript Graphing. | -* create-table on relational-database: Database Operations. | -* create-view on relational-database: Database Operations. | -* cring:define-rule: Commutative Rings. -* ctime: Posix Time. -* current-directory: Directories. -* current-error-port: Input/Output. -* current-input-port <1>: Byte. + (line 65) | +* codons<-cdna: NCBI-DNA. (line 18) | +* coerce: Type Coercion. (line 12) | +* collection?: Collections. (line 36) | +* color->ciexyz: Color Spaces. (line 34) | +* color->e-srgb: Color Spaces. (line 252) | +* color->l*a*b*: Color Spaces. (line 91) | +* color->l*c*h: Color Spaces. (line 166) | +* color->l*u*v*: Color Spaces. (line 115) | +* color->rgb709: Color Spaces. (line 55) | +* color->srgb: Color Spaces. (line 209) | +* color->string: Color Data-Type. (line 95) | +* color->xrgb: Color Spaces. (line 212) | +* color-dictionaries->lookup: Color Names. (line 33) | +* color-dictionary: Color Names. (line 40) | +* color-name->color: Color Names. (line 27) | +* color-name:canonicalize: Color Names. (line 23) | +* color-precision: Color Data-Type. (line 46) | +* color-space: Color Data-Type. (line 43) | +* color-white-point: Color Data-Type. (line 51) | +* color:ciexyz: Color Spaces. (line 30) | +* color:e-srgb: Color Spaces. (line 241) | +* color:l*a*b*: Color Spaces. (line 83) | +* color:l*c*h: Color Spaces. (line 159) | +* color:l*u*v*: Color Spaces. (line 107) | +* color:linear-transform: Color Conversions. (line 27) | +* color:rgb709: Color Spaces. (line 51) | +* color:srgb: Color Spaces. (line 200) | +* color?: Color Data-Type. (line 9) | +* column-domains on relational-table: Table Administration. + (line 9) | +* column-foreigns on relational-table: Table Administration. + (line 8) | +* column-names on relational-table: Table Administration. + (line 7) | +* column-range: Column Ranges. (line 10) | +* column-types on relational-table: Table Administration. + (line 10) | +* combine-ranges: Column Ranges. (line 19) | +* combined-rulesets: Commutative Rings. (line 90) | +* command->p-specs: HTML. (line 149) | +* command:make-editable-table: HTML Tables. (line 98) | +* command:modify-table: HTML Tables. (line 87) | +* concatenate: SRFI-1. (line 90) | +* concatenate!: SRFI-1. (line 91) | +* cond-expand: SRFI. (line 20) | +* cons*: SRFI-1. (line 22) | +* continue: Breakpoints. (line 20) | +* convert-color: Color Data-Type. (line 54) | +* copy-bit: Bit-Twiddling. (line 144) | +* copy-bit-field: Bit-Twiddling. (line 167) | +* copy-list: List construction. (line 32) | +* copy-random-state: Exact Random Numbers. + (line 29) | +* copy-tree: Tree Operations. (line 33) | +* count: SRFI-1. (line 106) | +* count-newlines: String Search. (line 61) | +* crc16: Cyclic Checksum. (line 167) | +* crc5: Cyclic Checksum. (line 178) | +* crc:make-table: Cyclic Checksum. (line 131) | +* create-array: Arrays. (line 66) | +* create-database: Using Databases. (line 43) | +* create-database on relational-system: Relational Database Objects. + (line 34) | +* create-postscript-graph: PostScript Graphing. (line 17) | +* create-table on relational-database: Database Operations. (line 64) | +* create-view on relational-database: Database Operations. (line 75) | +* cring:define-rule: Commutative Rings. (line 116) | +* ctime: Posix Time. (line 68) | +* current-directory: Directories. (line 9) | +* current-error-port: Input/Output. (line 70) | +* current-input-port <1>: Byte. (line 74) | * current-input-port: Ruleset Definition and Use. -* current-output-port: Byte. -* current-time: Time and Date. -* cvs-directories: CVS. -* cvs-files: CVS. -* cvs-repository: CVS. -* cvs-root: CVS. -* cvs-set-root!: CVS. -* cvs-vet: CVS. -* db->html-directory: HTML Tables. -* db->html-files: HTML Tables. -* db->netscape: HTML Tables. -* decode-universal-time: Common-Lisp Time. -* define-*commands*: Database Extension. -* define-access-operation: Setters. -* define-command: Database Macros. -* define-domains: Using Databases. | -* define-operation: Yasos interface. -* define-predicate: Yasos interface. -* define-record-type: SRFI-9. | -* define-structure: Syntax-Case Macros. | -* define-syntax: Macro by Example. -* define-table: Database Macros. -* define-tables: Using Databases. -* defmacro: Defmacro. -* defmacro:eval: Defmacro. -* defmacro:expand*: Defmacro. -* defmacro:load: Defmacro. -* defmacro?: Defmacro. -* delay: Promises. | -* delete: Destructive list operations. | -* delete on base-table: Base Record Operations. | -* delete* on base-table: Aggregate Base Operations. | -* delete-domain on relational-database: Command Intrinsics. | -* delete-file: Input/Output. + (line 57) | +* current-output-port: Byte. (line 66) | +* current-time: Time and Date. (line 20) | +* cvs-directories: CVS. (line 14) | +* cvs-files: CVS. (line 9) | +* cvs-repository: CVS. (line 22) | +* cvs-root: CVS. (line 18) | +* cvs-set-root!: CVS. (line 27) | +* cvs-set-roots!: CVS. (line 30) | +* cvs-vet: CVS. (line 34) | +* db->html-directory: HTML Tables. (line 147) | +* db->html-files: HTML Tables. (line 137) | +* db->netscape: HTML Tables. (line 158) | +* decode-universal-time: Common-Lisp Time. (line 15) | +* define-*commands*: Database Extension. (line 16) | +* define-access-operation: Setters. (line 53) | +* define-command: Within-database. (line 17) | +* define-domains: Using Databases. (line 124) | +* define-macro: Within-database. (line 58) | +* define-operation: Yasos interface. (line 7) | +* define-predicate: Yasos interface. (line 12) | +* define-record-type: SRFI-9. (line 12) | +* define-structure: Define-Structure. (line 12) | +* define-syntax: Macro by Example. (line 39) | +* define-table: Within-database. (line 26) | +* define-tables: Using Databases. (line 134) | +* defmacro: Defmacro. (line 40) | +* defmacro:eval: Defmacro. (line 15) | +* defmacro:expand*: Defmacro. (line 51) | +* defmacro:load: Defmacro. (line 19) | +* defmacro?: Defmacro. (line 27) | +* delaminate-list: Hilbert Space-Filling Curve. | + (line 108) | +* delay: Promises. (line 15) | +* delete: Destructive list operations. + (line 58) | +* delete on base-table: Base Record Operations. + (line 37) | +* delete* on base-table: Aggregate Base Operations. + (line 11) | +* delete-domain on relational-database: Command Intrinsics. (line 39) | +* delete-duplicates: SRFI-1. (line 166) | +* delete-duplicates!: SRFI-1. (line 169) | +* delete-file: Input/Output. (line 14) | * delete-if: Destructive list operations. + (line 59) | * delete-if-not: Destructive list operations. -* delete-table on relational-database: Database Operations. | -* dequeue!: Queues. -* dequeue-all!: Queues. -* determinant: Matrix Algebra. -* diff:edit-length: Sequence Comparison. -* diff:edits: Sequence Comparison. -* diff:longest-common-subsequence: Sequence Comparison. -* difftime: Time and Date. -* directory-for-each: Directories. | -* do-elts: Collections. -* do-keys: Collections. -* domain-checker on relational-database: Command Intrinsics. | -* dotted-list?: SRFI-1. -* drop: SRFI-1. -* drop-right: SRFI-1. | -* drop-right!: SRFI-1. | -* dynamic-ref: Dynamic Data Type. -* dynamic-set!: Dynamic Data Type. -* dynamic-wind: Dynamic-Wind. -* dynamic?: Dynamic Data Type. -* e-sRGB->CIEXYZ: Color Conversions. -* e-srgb->color: Color Spaces. -* e-sRGB->e-sRGB: Color Conversions. -* e-sRGB->sRGB: Color Conversions. -* eighth: SRFI-1. -* emacs:backup-name: Transactions. -* empty?: Collections. -* encode-universal-time: Common-Lisp Time. -* enqueue!: Queues. -* equal?: Byte. -* eval: Eval. -* every: Lists as sets. -* every?: Collections. -* exports<-info-index: Top-level Variable References. | -* extended-euclid: Modular Arithmetic. -* factor: Prime Numbers. -* feature->export-alist: Module Manifests. | -* feature->exports: Module Manifests. | -* feature->requires: Module Manifests. | -* feature-eval: Feature. | + (line 60) | +* delete-table on relational-database: Database Operations. (line 59) | +* dequeue!: Queues. (line 28) | +* dequeue-all!: Queues. (line 36) | +* determinant: Matrix Algebra. (line 18) | +* diff:edit-length: Sequence Comparison. (line 64) | +* diff:edits: Sequence Comparison. (line 45) | +* diff:longest-common-subsequence: Sequence Comparison. (line 32) | +* difftime: Time and Date. (line 26) | +* directory-for-each: Directories. (line 21) | +* do-elts: Collections. (line 41) | +* do-keys: Collections. (line 57) | +* domain-checker on relational-database: Command Intrinsics. (line 42) | +* dotted-list?: SRFI-1. (line 42) | +* drop: SRFI-1. (line 70) | +* drop-right: SRFI-1. (line 76) | +* drop-right!: SRFI-1. (line 78) | +* dynamic-ref: Dynamic Data Type. (line 17) | +* dynamic-set!: Dynamic Data Type. (line 21) | +* dynamic-wind: Dynamic-Wind. (line 13) | +* dynamic?: Dynamic Data Type. (line 12) | +* e-sRGB->CIEXYZ: Color Conversions. (line 57) | +* e-srgb->color: Color Spaces. (line 235) | +* e-sRGB->e-sRGB: Color Conversions. (line 68) | +* e-sRGB->sRGB: Color Conversions. (line 60) | +* eighth: SRFI-1. (line 64) | +* emacs:backup-name: Transactions. (line 73) | +* empty?: Collections. (line 99) | +* encode-universal-time: Common-Lisp Time. (line 40) | +* enqueue!: Queues. (line 25) | +* equal? <1>: Byte. (line 44) | +* equal?: Arrays. (line 19) | +* eval: Eval. (line 9) | +* every: Lists as sets. (line 91) | +* every?: Collections. (line 91) | +* exports<-info-index: Top-level Variable References. + (line 35) | +* expt: Miscellany. (line 20) | +* extended-euclid: Modular Arithmetic. (line 28) | +* factor: Prime Numbers. (line 41) | +* feature->export-alist: Module Manifests. (line 100) | +* feature->exports: Module Manifests. (line 105) | +* feature->requires: Module Manifests. (line 29) | +* feature->requires*: Module Manifests. (line 45) | +* feature-eval: Feature. (line 52) | * fft: Fast Fourier Transform. + (line 9) | * fft-1: Fast Fourier Transform. -* fifth: SRFI-1. -* file->color-dictionary: Color Names. -* file->definitions: Module Manifests. | -* file->exports: Module Manifests. | -* file->loads: Module Manifests. | -* file->requires: Module Manifests. | -* file-exists?: Input/Output. -* file-lock!: Transactions. -* file-lock-owner: Transactions. -* file-unlock!: Transactions. | -* filename:match-ci??: Filenames. -* filename:match??: Filenames. -* filename:substitute-ci??: Filenames. -* filename:substitute??: Filenames. -* fill-empty-parameters: Parameter lists. -* fill-rect: Rectangles. | -* filter: SRFI-1. | -* filter!: SRFI-1. | -* 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: Collections. | -* for-each-key on base-table: Aggregate Base Operations. | -* for-each-row on relational-table: Multi-Row Operations. | -* for-each-row-in-order on relational-table: Sequential Index Operations. | -* force: Promises. | -* force-output: Input/Output. -* form:delimited: HTML. -* form:element: HTML. -* form:image: HTML. -* form:reset: HTML. -* form:submit: HTML. -* fourth: SRFI-1. | + (line 14) | +* fifth: SRFI-1. (line 61) | +* file->color-dictionary: Color Names. (line 68) | +* file->definitions: Module Manifests. (line 72) | +* file->exports: Module Manifests. (line 84) | +* file->loads: Module Manifests. (line 53) | +* file->requires: Module Manifests. (line 15) | +* file->requires*: Module Manifests. (line 49) | +* file-exists?: Input/Output. (line 9) | +* file-lock!: Transactions. (line 52) | +* file-lock-owner: Transactions. (line 48) | +* file-unlock!: Transactions. (line 62) | +* filename:match-ci??: Filenames. (line 10) | +* filename:match??: Filenames. (line 9) | +* filename:substitute-ci??: Filenames. (line 35) | +* filename:substitute??: Filenames. (line 34) | +* fill-empty-parameters: Parameter lists. (line 51) | +* fill-rect: Rectangles. (line 30) | +* filter: SRFI-1. (line 129) | +* filter!: SRFI-1. (line 131) | +* find: SRFI-1. (line 144) | +* find-if: Lists as sets. (line 138) | +* find-ratio: Rationalize. (line 20) | +* find-ratio-between: Rationalize. (line 27) | +* find-string-from-port?: String Search. (line 30) | +* find-tail: SRFI-1. (line 146) | +* first: SRFI-1. (line 53) | +* first-set-bit: Bit-Twiddling. (line 100) | +* fluid-let: Fluid-Let. (line 9) | +* fold: SRFI-1. (line 111) | +* fold-right: SRFI-1. (line 113) | +* for-each-elt: Collections. (line 67) | +* for-each-key: Collections. (line 66) | +* for-each-key on base-table: Aggregate Base Operations. + (line 16) | +* for-each-row on relational-table: Multi-Row Operations. + (line 33) | +* for-each-row-in-order on relational-table: Sequential Index Operations. + (line 11) | +* force: Promises. (line 11) | +* force-output: Input/Output. (line 74) | +* form:delimited: HTML. (line 138) | +* form:element: HTML. (line 98) | +* form:image: HTML. (line 92) | +* form:reset: HTML. (line 95) | +* form:submit: HTML. (line 84) | +* format: Format Interface. (line 7) | +* fourth: SRFI-1. (line 59) | * fprintf: Standard Formatted Output. + (line 10) | * fscanf: Standard Formatted Input. -* gen-elts: Collections. | -* gen-keys: Collections. | -* generic-write: Generic-Write. -* gentemp: Defmacro. -* get on relational-table: Table Operations. | -* get* on relational-table: Match-Keys. | -* get-decoded-time: Common-Lisp Time. -* get-foreign-choices: HTML. | -* get-method: Object. -* get-universal-time: Common-Lisp Time. -* getenv: System Interface. -* getopt: Getopt. -* getopt--: Getopt. | + (line 14) | +* gen-elts: Collections. (line 25) | +* gen-keys: Collections. (line 29) | +* generic-write: Generic-Write. (line 15) | +* gentemp: Defmacro. (line 9) | +* get on relational-table: Table Operations. (line 18) | +* get* on relational-table: Match-Keys. (line 29) | +* get-decoded-time: Common-Lisp Time. (line 7) | +* get-foreign-choices: HTML. (line 146) | +* get-method: Object. (line 78) | +* get-universal-time: Common-Lisp Time. (line 10) | +* getenv: System Interface. (line 9) | +* getopt: Getopt. (line 39) | +* getopt--: Getopt. (line 125) | * getopt->arglist: Getopt Parameter lists. + (line 37) | * getopt->parameter-list: Getopt Parameter lists. -* glob-pattern?: URI. -* gmktime: Posix Time. -* gmtime: Posix Time. -* golden-section-search: Minimizing. -* gray-code->integer: Bit-Twiddling. -* gray-code<=?: Bit-Twiddling. -* gray-code<?: Bit-Twiddling. -* gray-code>=?: Bit-Twiddling. -* gray-code>?: Bit-Twiddling. -* grey: Color Names. -* grid-horizontals: Legending. | -* grid-verticals: Legending. | -* gtime: Posix Time. -* has-duplicates?: Lists as sets. -* hash: Hashing. -* hash-associator: Hash Tables. -* hash-for-each: Hash Tables. -* hash-inquirer: Hash Tables. -* hash-map: Hash Tables. -* hash-rehasher: Hash Tables. | -* hash-remover: Hash Tables. -* hashq: Hashing. -* hashv: Hashing. -* heap-extract-max!: Priority Queues. -* heap-insert!: Priority Queues. -* heap-length: Priority Queues. -* hilbert-coordinates->integer: Peano-Hilbert Space-Filling Curve. -* histograph: Character Plotting. | -* home-vicinity: Vicinity. -* htm-fields: Parsing HTML. -* html-for-each: Parsing HTML. -* 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:delimited-list: 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:read-title: Parsing 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: Miscellany. -* ieee-byte-collate: Byte/Number Conversions. | -* ieee-byte-collate!: Byte/Number Conversions. | -* ieee-byte-decollate: Byte/Number Conversions. | -* ieee-byte-decollate!: Byte/Number Conversions. | -* ieee-double->bytes: Byte/Number Conversions. | -* ieee-float->bytes: Byte/Number Conversions. | -* implementation-vicinity: Vicinity. -* in-graphic-context: Graphics Context. | -* in-vicinity: Vicinity. -* init-debug: Breakpoints. -* integer->bytes: Byte/Number Conversions. | -* integer->gray-code: Bit-Twiddling. -* integer->hilbert-coordinates: Peano-Hilbert Space-Filling Curve. -* integer->list: Bit-Twiddling. -* integer-byte-collate: Byte/Number Conversions. | -* integer-byte-collate!: Byte/Number Conversions. | -* integer-expt: Bit-Twiddling. -* integer-length: Bit-Twiddling. -* integer-sqrt: Root Finding. -* interaction-environment: Eval. -* interpolate-from-table: Database Interpolation. | -* intersection: Lists as sets. -* iota: SRFI-1. -* isam-next on relational-table: Sequential Index Operations. | -* isam-prev on relational-table: Sequential Index Operations. | -* jacobi-symbol: Prime Numbers. -* kill-process!: Multi-Processing. -* kill-table on base-table: Base Tables. | -* L*a*b*->CIEXYZ: Color Conversions. -* l*a*b*->color: Color Spaces. -* L*a*b*->L*C*h: Color Conversions. -* L*a*b*:DE*: Color Difference Metrics. | -* l*c*h->color: Color Spaces. -* L*C*h->L*a*b*: Color Conversions. -* L*C*h:DE*94: Color Difference Metrics. | -* L*u*v*->CIEXYZ: Color Conversions. -* l*u*v*->color: Color Spaces. -* laguerre:find-polynomial-root: Root Finding. -* laguerre:find-root: Root Finding. -* last <1>: SRFI-1. -* last: Lists as sequences. -* last-pair: Miscellany. -* length+: SRFI-1. -* library-vicinity: Vicinity. -* light:ambient: Solid Modeling. -* light:beam: Solid Modeling. -* light:directional: Solid Modeling. -* light:point: Solid Modeling. -* light:spot: Solid Modeling. -* list*: List construction. -* list->bytes: Byte. -* list->integer: Bit-Twiddling. -* list->string: Rev4 Optional Procedures. -* list->vector: Rev4 Optional Procedures. -* list-copy: SRFI-1. | -* list-index: SRFI-1. | -* list-of??: Lists as sets. -* list-table-definition: Using Databases. -* list-tabulate: SRFI-1. + (line 10) | +* glob-pattern?: URI. (line 110) | +* gmktime: Posix Time. (line 50) | +* gmtime: Posix Time. (line 36) | +* golden-section-search: Minimizing. (line 18) | +* gray-code->integer: Hilbert Space-Filling Curve. | + (line 65) | +* gray-code<=?: Hilbert Space-Filling Curve. | + (line 75) | +* gray-code<?: Hilbert Space-Filling Curve. | + (line 73) | +* gray-code>=?: Hilbert Space-Filling Curve. | + (line 76) | +* gray-code>?: Hilbert Space-Filling Curve. | + (line 74) | +* grey: Color Names. (line 13) | +* grid-horizontals: Legending. (line 58) | +* grid-verticals: Legending. (line 54) | +* gtime: Posix Time. (line 67) | +* has-duplicates?: Lists as sets. (line 187) | +* hash: Hashing. (line 14) | +* hash-associator: Hash Tables. (line 36) | +* hash-for-each: Hash Tables. (line 51) | +* hash-inquirer: Hash Tables. (line 31) | +* hash-map: Hash Tables. (line 46) | +* hash-rehasher: Hash Tables. (line 56) | +* hash-remover: Hash Tables. (line 41) | +* hashq: Hashing. (line 12) | +* hashv: Hashing. (line 13) | +* heap-extract-max!: Priority Queues. (line 23) | +* heap-insert!: Priority Queues. (line 19) | +* heap-length: Priority Queues. (line 16) | +* hilbert-coordinates->integer: Hilbert Space-Filling Curve. | + (line 45) | +* histograph: Character Plotting. (line 83) | +* home-vicinity: Vicinity. (line 51) | +* htm-fields: Parsing HTML. (line 58) | +* html-for-each: Parsing HTML. (line 10) | +* html:anchor: URI. (line 24) | +* html:atval: HTML. (line 9) | +* html:base: URI. (line 39) | +* html:body: HTML. (line 47) | +* html:buttons: HTML. (line 81) | +* html:caption: HTML Tables. (line 11) | +* html:checkbox: HTML. (line 69) | +* html:comment: HTML. (line 55) | +* html:delimited-list: HTML. (line 143) | +* html:editable-row-converter: HTML Tables. (line 117) | +* html:form: HTML. (line 61) | +* html:head: HTML. (line 39) | +* html:heading: HTML Tables. (line 15) | +* html:hidden: HTML. (line 66) | +* html:href-heading: HTML Tables. (line 18) | +* html:http-equiv: HTML. (line 24) | +* html:isindex: URI. (line 43) | +* html:link: URI. (line 32) | +* html:linked-row-converter: HTML Tables. (line 22) | +* html:meta: HTML. (line 17) | +* html:meta-refresh: HTML. (line 30) | +* html:plain: HTML. (line 13) | +* html:pre: HTML. (line 50) | +* html:read-title: Parsing HTML. (line 44) | +* html:select: HTML. (line 78) | +* html:table: HTML Tables. (line 9) | +* html:text: HTML. (line 72) | +* html:text-area: HTML. (line 75) | +* http:content: HTTP and CGI. (line 13) | +* http:error-page: HTTP and CGI. (line 20) | +* http:forwarding-page: HTTP and CGI. (line 26) | +* http:header: HTTP and CGI. (line 9) | +* http:serve-query: HTTP and CGI. (line 36) | +* identifier=?: Syntactic Closures. (line 369) | +* identifier?: Syntactic Closures. (line 334) | +* identity: Miscellany. (line 9) | +* ieee-byte-collate: Byte/Number Conversions. + (line 144) | +* ieee-byte-collate!: Byte/Number Conversions. + (line 135) | +* ieee-byte-decollate: Byte/Number Conversions. + (line 148) | +* ieee-byte-decollate!: Byte/Number Conversions. + (line 140) | +* ieee-double->bytes: Byte/Number Conversions. + (line 92) | +* ieee-float->bytes: Byte/Number Conversions. + (line 76) | +* illuminant-map: Spectra. (line 77) | +* illuminant-map->XYZ: Spectra. (line 82) | +* implementation-vicinity: Vicinity. (line 42) | +* in-graphic-context: Graphics Context. (line 7) | +* in-vicinity: Vicinity. (line 62) | +* init-debug: Breakpoints. (line 9) | +* integer->bytes: Byte/Number Conversions. + (line 29) | +* integer->gray-code: Hilbert Space-Filling Curve. | + (line 62) | +* integer->hilbert-coordinates: Hilbert Space-Filling Curve. | + (line 30) | +* integer->list: Bit-Twiddling. (line 215) | +* integer->peano-coordinates: Peano Space-Filling Curve. | + (line 7) | +* integer-byte-collate: Byte/Number Conversions. + (line 129) | +* integer-byte-collate!: Byte/Number Conversions. + (line 123) | +* integer-length: Bit-Twiddling. (line 88) | +* integer-sqrt: Root Finding. (line 26) | +* interaction-environment: Eval. (line 51) | +* interpolate-from-table: Database Interpolation. + (line 13) | +* intersection: Lists as sets. (line 32) | +* iota: SRFI-1. (line 26) | +* isam-next on relational-table: Sequential Index Operations. + (line 18) | +* isam-prev on relational-table: Sequential Index Operations. + (line 29) | +* jacobi-symbol: Prime Numbers. (line 20) | +* kill-process!: Multi-Processing. (line 24) | +* kill-table on base-table: Base Tables. (line 26) | +* L*a*b*->CIEXYZ: Color Conversions. (line 40) | +* l*a*b*->color: Color Spaces. (line 78) | +* L*a*b*->L*C*h: Color Conversions. (line 44) | +* L*a*b*:DE*: Color Difference Metrics. + (line 17) | +* l*c*h->color: Color Spaces. (line 154) | +* L*C*h->L*a*b*: Color Conversions. (line 45) | +* L*C*h:DE*94: Color Difference Metrics. + (line 25) | +* L*u*v*->CIEXYZ: Color Conversions. (line 34) | +* l*u*v*->color: Color Spaces. (line 102) | +* laguerre:find-polynomial-root: Root Finding. (line 58) | +* laguerre:find-root: Root Finding. (line 47) | +* last <1>: SRFI-1. (line 83) | +* last: Lists as sequences. (line 111) | +* last-pair: Miscellany. (line 73) | +* length+: SRFI-1. (line 88) | +* library-vicinity: Vicinity. (line 39) | +* light:ambient: Solid Modeling. (line 110) | +* light:beam: Solid Modeling. (line 144) | +* light:directional: Solid Modeling. (line 122) | +* light:point: Solid Modeling. (line 158) | +* light:spot: Solid Modeling. (line 176) | +* list*: List construction. (line 18) | +* list->array: Arrays. (line 88) | +* list->bytes: Byte. (line 40) | +* list->integer: Bit-Twiddling. (line 221) | +* list-copy: SRFI-1. (line 24) | +* list-index: SRFI-1. (line 158) | +* list-of??: Lists as sets. (line 120) | +* list-table-definition: Using Databases. (line 167) | +* list-tabulate: SRFI-1. (line 18) | * list-tail: Rev4 Optional Procedures. -* list=: SRFI-1. -* load->path: Module Manifests. | -* load-ciexyz: Spectra. | -* load-color-dictionary: Color Names. | -* localtime: Posix Time. -* logand: Bit-Twiddling. -* logbit?: Bit-Twiddling. -* logcount: Bit-Twiddling. -* logical:ones: Bit-Twiddling. | -* logical:rotate: Bit-Twiddling. -* logior: Bit-Twiddling. -* lognot: Bit-Twiddling. -* logtest: Bit-Twiddling. -* logxor: Bit-Twiddling. -* macro:eval <1>: Syntax-Case Macros. -* macro:eval <2>: Syntactic Closures. -* macro:eval <3>: Macros That Work. -* macro:eval: R4RS Macros. -* macro:expand <1>: Syntax-Case Macros. -* macro:expand <2>: Syntactic Closures. -* macro:expand <3>: Macros That Work. -* macro:expand: R4RS Macros. -* macro:load <1>: Syntax-Case Macros. -* macro:load <2>: Syntactic Closures. -* macro:load <3>: Macros That Work. -* macro:load: R4RS Macros. -* macroexpand: Defmacro. -* macroexpand-1: Defmacro. -* macwork:eval: Macros That Work. -* macwork:expand: Macros That Work. -* macwork:load: Macros That Work. -* make-base on base-table: The Base. | -* make-bytes: Byte. -* make-color: Color Data-Type. -* make-command-server: Command Service. -* make-directory: Directories. -* make-dynamic: Dynamic Data Type. -* make-exchanger: Miscellany. -* make-generic-method: Object. -* make-generic-predicate: Object. -* make-getter on base-table: Base Record Operations. | -* make-getter-1 on base-table: Base Record Operations. | -* make-hash-table: Hash Tables. -* make-heap: Priority Queues. -* make-key->list on base-table: Composite Keys. | -* make-key-extractor on base-table: Composite Keys. | -* make-keyifier-1 on base-table: Composite Keys. | -* make-list: List construction. -* make-list-keyifier on base-table: Composite Keys. | -* make-method!: Object. -* make-nexter on base-table: Base ISAM Operations. | -* make-object: Object. -* make-parameter-list: Parameter lists. -* make-predicate!: Object. -* make-prever on base-table: Base ISAM Operations. | -* make-promise: Promises. -* make-putter on base-table: Base Record Operations. | -* make-query-alist-command-server: HTTP and CGI. -* make-queue: Queues. -* make-random-state: Exact Random Numbers. | -* make-record-type: Records. + (line 12) | +* list=: SRFI-1. (line 48) | +* load->path: Module Manifests. (line 63) | +* load-ciexyz: Spectra. (line 37) | +* load-color-dictionary: Color Names. (line 52) | +* localtime: Posix Time. (line 39) | +* log2-binary-factors: Bit-Twiddling. (line 99) | +* logand: Bit-Twiddling. (line 18) | +* logbit?: Bit-Twiddling. (line 134) | +* logcount: Bit-Twiddling. (line 73) | +* logior: Bit-Twiddling. (line 27) | +* lognot: Bit-Twiddling. (line 45) | +* logtest: Bit-Twiddling. (line 63) | +* logxor: Bit-Twiddling. (line 36) | +* lset-adjoin: SRFI-1. (line 197) | +* lset-diff+intersection: SRFI-1. (line 207) | +* lset-diff+intersection!: SRFI-1. (line 222) | +* lset-difference: SRFI-1. (line 203) | +* lset-difference!: SRFI-1. (line 216) | +* lset-intersection: SRFI-1. (line 201) | +* lset-intersection!: SRFI-1. (line 214) | +* lset-union: SRFI-1. (line 199) | +* lset-union!: SRFI-1. (line 218) | +* lset-xor: SRFI-1. (line 205) | +* lset-xor!: SRFI-1. (line 220) | +* lset<=: SRFI-1. (line 191) | +* lset=: SRFI-1. (line 195) | +* macro:eval <1>: Syntax-Case Macros. (line 14) | +* macro:eval <2>: Syntactic Closures. (line 14) | +* macro:eval <3>: Macros That Work. (line 18) | +* macro:eval: R4RS Macros. (line 19) | +* macro:expand <1>: Syntax-Case Macros. (line 9) | +* macro:expand <2>: Syntactic Closures. (line 9) | +* macro:expand <3>: Macros That Work. (line 13) | +* macro:expand: R4RS Macros. (line 15) | +* macro:load <1>: Syntax-Case Macros. (line 20) | +* macro:load <2>: Syntactic Closures. (line 20) | +* macro:load <3>: Macros That Work. (line 24) | +* macro:load: R4RS Macros. (line 23) | +* macroexpand: Defmacro. (line 31) | +* macroexpand-1: Defmacro. (line 30) | +* macwork:eval: Macros That Work. (line 19) | +* macwork:expand: Macros That Work. (line 14) | +* macwork:load: Macros That Work. (line 25) | +* make-array: Arrays. (line 54) | +* make-base on base-table: The Base. (line 19) | +* make-bytes: Byte. (line 23) | +* make-color: Color Data-Type. (line 30) | +* make-command-server: Command Service. (line 7) | +* make-directory: Directories. (line 17) | +* make-dynamic: Dynamic Data Type. (line 9) | +* make-exchanger: Miscellany. (line 37) | +* make-generic-method: Object. (line 57) | +* make-generic-predicate: Object. (line 62) | +* make-getter on base-table: Base Record Operations. + (line 14) | +* make-getter-1 on base-table: Base Record Operations. + (line 23) | +* make-hash-table: Hash Tables. (line 17) | +* make-heap: Priority Queues. (line 12) | +* make-key->list on base-table: Composite Keys. (line 38) | +* make-key-extractor on base-table: Composite Keys. (line 31) | +* make-keyifier-1 on base-table: Composite Keys. (line 7) | +* make-list: List construction. (line 7) | +* make-list-keyifier on base-table: Composite Keys. (line 17) | +* make-method!: Object. (line 65) | +* make-nexter on base-table: Base ISAM Operations. + (line 17) | +* make-object: Object. (line 46) | +* make-parameter-list: Parameter lists. (line 23) | +* make-predicate!: Object. (line 72) | +* make-prever on base-table: Base ISAM Operations. + (line 25) | +* make-promise: Promises. (line 9) | +* make-putter on base-table: Base Record Operations. + (line 31) | +* make-query-alist-command-server: HTTP and CGI. (line 86) | +* make-queue: Queues. (line 13) | +* make-random-state: Exact Random Numbers. + (line 44) | +* make-record-type: Records. (line 12) | * make-relational-system: Relational Database Objects. -* make-ruleset: Commutative Rings. -* make-shared-array: Arrays. -* make-sierpinski-indexer: Sierpinski Curve. -* make-slib-color-name-db: Color Names. -* make-syntactic-closure: Syntactic Closures. -* make-table on base-table: Base Tables. | -* make-uri: URI. -* make-vicinity: Vicinity. + (line 11) | +* make-ruleset: Commutative Rings. (line 82) | +* make-shared-array: Arrays. (line 69) | +* make-sierpinski-indexer: Sierpinski Curve. (line 9) | +* make-slib-color-name-db: Color Names. (line 94) | +* make-syntactic-closure: Syntactic Closures. (line 177) | +* make-table on base-table: Base Tables. (line 7) | +* make-uri: URI. (line 12) | +* make-vicinity: Vicinity. (line 21) | * make-wt-tree: Construction of Weight-Balanced Trees. + (line 51) | * make-wt-tree-type: Construction of Weight-Balanced Trees. -* map!: SRFI-1. | -* map-elts: Collections. -* map-key on base-table: Aggregate Base Operations. | -* map-keys: Collections. -* matfile:load: MAT-File Format. -* matfile:read: MAT-File Format. -* matrix->array: Matrix Algebra. -* matrix->lists: Matrix Algebra. -* matrix:inverse: Matrix Algebra. -* matrix:product: Matrix Algebra. -* mdbm:report: Using Databases. -* member: SRFI-1. -* member-if: Lists as sets. -* merge: Sorting. -* merge!: Sorting. -* mktime: Posix Time. -* mod: Modular Arithmetic. | -* modular:*: Modular Arithmetic. -* modular:+: Modular Arithmetic. -* modular:-: Modular Arithmetic. | -* modular:expt: Modular Arithmetic. -* modular:invert: Modular Arithmetic. -* modular:invertable?: Modular Arithmetic. -* modular:negate: Modular Arithmetic. -* modular:normalize: Modular Arithmetic. -* modulus->integer: Modular Arithmetic. -* mrna<-cdna: NCBI-DNA. -* must-be-first: Batch. -* must-be-last: Batch. -* ncbi:read-dna-sequence: NCBI-DNA. -* ncbi:read-file: NCBI-DNA. + (line 19) | +* map!: SRFI-1. (line 122) | +* map-elts: Collections. (line 40) | +* map-key on base-table: Aggregate Base Operations. + (line 22) | +* map-keys: Collections. (line 56) | +* matfile:load: MAT-File Format. (line 25) | +* matfile:read: MAT-File Format. (line 19) | +* matrix->array: Matrix Algebra. (line 15) | +* matrix->lists: Matrix Algebra. (line 12) | +* matrix:inverse: Matrix Algebra. (line 33) | +* matrix:product: Matrix Algebra. (line 30) | +* mdbm:report: Using Databases. (line 94) | +* member: SRFI-1. (line 160) | +* member-if: Lists as sets. (line 62) | +* merge: Sorting. (line 97) | +* merge!: Sorting. (line 106) | +* mktime: Posix Time. (line 54) | +* mod: Modular Arithmetic. (line 9) | +* modular:*: Modular Arithmetic. (line 77) | +* modular:+: Modular Arithmetic. (line 71) | +* modular:-: Modular Arithmetic. (line 74) | +* modular:expt: Modular Arithmetic. (line 83) | +* modular:invert: Modular Arithmetic. (line 64) | +* modular:invertable?: Modular Arithmetic. (line 60) | +* modular:negate: Modular Arithmetic. (line 68) | +* modular:normalize: Modular Arithmetic. (line 39) | +* modulus->integer: Modular Arithmetic. (line 35) | +* mrna<-cdna: NCBI-DNA. (line 15) | +* must-be-first: Batch. (line 128) | +* must-be-last: Batch. (line 133) | +* ncbi:read-dna-sequence: NCBI-DNA. (line 7) | +* ncbi:read-file: NCBI-DNA. (line 11) | * nconc: Destructive list operations. -* newton:find-integer-root: Root Finding. -* newton:find-root: Root Finding. -* ninth: SRFI-1. -* not-pair?: SRFI-1. -* notany: Lists as sets. -* notevery: Lists as sets. + (line 10) | +* newton:find-integer-root: Root Finding. (line 9) | +* newton:find-root: Root Finding. (line 30) | +* ninth: SRFI-1. (line 65) | +* not-pair?: SRFI-1. (line 46) | +* notany: Lists as sets. (line 105) | +* notevery: Lists as sets. (line 109) | * nreverse: Destructive list operations. -* nthcdr: Lists as sequences. -* null-directory?: URI. -* null-environment: Eval. -* null-list?: SRFI-1. -* object: Yasos interface. -* object->limited-string: Object-To-String. -* object->string: Object-To-String. -* object-with-ancestors: Yasos interface. -* object?: Object. -* offset-time: Time and Date. -* open-base on base-table: The Base. | -* open-command-database: Database Extension. -* open-command-database!: Database Extension. | -* open-database: Using Databases. -* open-database on relational-system: Relational Database Objects. | -* open-database!: Using Databases. -* open-file <1>: Byte. | -* open-file: Input/Output. -* open-table: Using Databases. | -* open-table on base-table: Base Tables. | -* open-table on relational-database: Database Operations. | -* open-table!: Using Databases. | -* operate-as: Yasos interface. -* or?: Non-List functions. -* ordered-for-each-key on base-table: Base ISAM Operations. | -* os->batch-dialect: Batch. -* outline-rect: Rectangles. | -* output-port-height: Input/Output. -* output-port-width: Input/Output. -* overcast-sky-color-xyy: Daylight. -* p<-cdna: NCBI-DNA. -* pad-range: Column Ranges. | -* pair-for-each: SRFI-1. | -* parameter-list->arglist: Parameter lists. -* parameter-list-expand: Parameter lists. -* parameter-list-ref: Parameter lists. -* parse-ftp-address: URI. -* partition: SRFI-1. | -* partition-page: Rectangles. | -* path->uri: URI. -* pathname->vicinity: Vicinity. -* plot <1>: Legacy Plotting. | -* plot: Character Plotting. | -* plot-column: Drawing the Graph. | + (line 38) | +* nthcdr: Lists as sequences. (line 137) | +* null-directory?: URI. (line 106) | +* null-environment: Eval. (line 29) | +* null-list?: SRFI-1. (line 44) | +* object: Yasos interface. (line 17) | +* object->limited-string: Object-To-String. (line 12) | +* object->string: Object-To-String. (line 9) | +* object-with-ancestors: Yasos interface. (line 23) | +* object?: Object. (line 54) | +* offset-time: Time and Date. (line 30) | +* open-base on base-table: The Base. (line 33) | +* open-command-database: Database Extension. (line 34) | +* open-command-database!: Database Extension. (line 43) | +* open-database: Using Databases. (line 71) | +* open-database on relational-system: Relational Database Objects. + (line 45) | +* open-database!: Using Databases. (line 68) | +* open-file <1>: Byte. (line 57) | +* open-file: Input/Output. (line 18) | +* open-table: Using Databases. (line 107) | +* open-table on base-table: Base Tables. (line 16) | +* open-table on relational-database: Database Operations. (line 52) | +* open-table!: Using Databases. (line 114) | +* operate-as: Yasos interface. (line 31) | +* or?: Non-List functions. (line 19) | +* ordered-for-each-key on base-table: Base ISAM Operations. + (line 10) | +* os->batch-dialect: Batch. (line 138) | +* outline-rect: Rectangles. (line 33) | +* output-port-height: Input/Output. (line 87) | +* output-port-width: Input/Output. (line 81) | +* overcast-sky-color-xyy: Daylight. (line 74) | +* p<-cdna: NCBI-DNA. (line 27) | +* pad-range: Column Ranges. (line 13) | +* pair-fold: SRFI-1. (line 115) | +* pair-fold-right: SRFI-1. (line 117) | +* pair-for-each: SRFI-1. (line 124) | +* parameter-list->arglist: Parameter lists. (line 86) | +* parameter-list-expand: Parameter lists. (line 41) | +* parameter-list-ref: Parameter lists. (line 26) | +* parse-ftp-address: URI. (line 117) | +* partition: SRFI-1. (line 133) | +* partition!: SRFI-1. (line 137) | +* partition-page: Rectangles. (line 16) | +* path->uri: URI. (line 95) | +* pathname->vicinity: Vicinity. (line 25) | +* peano-coordinates->integer: Peano Space-Filling Curve. | + (line 13) | +* plot <1>: Legacy Plotting. (line 11) | +* plot: Character Plotting. (line 17) | +* plot-column: Drawing the Graph. (line 7) | * pnm:array-write: Portable Image Files. + (line 44) | * pnm:image-file->array: Portable Image Files. + (line 35) | * pnm:type-dimensions: Portable Image Files. -* port?: Input/Output. -* position: Lists as sequences. -* pprint-file: Pretty-Print. -* pprint-filter-file: Pretty-Print. + (line 9) | +* port?: Input/Output. (line 44) | +* position: Lists as sequences. (line 7) | +* pprint-file: Pretty-Print. (line 63) | +* pprint-filter-file: Pretty-Print. (line 69) | * prec:commentfix: Grammar Rule Definition. + (line 111) | * prec:define-grammar: Ruleset Definition and Use. + (line 24) | * prec:delim: Grammar Rule Definition. + (line 24) | * prec:infix: Grammar Rule Definition. + (line 53) | * prec:inmatchfix: Grammar Rule Definition. + (line 151) | * prec:make-led: Nud and Led Definition. + (line 49) | * prec:make-nud: Nud and Led Definition. + (line 39) | * prec:matchfix: Grammar Rule Definition. + (line 131) | * prec:nary: Grammar Rule Definition. + (line 72) | * prec:nofix: Grammar Rule Definition. + (line 29) | * prec:parse: Ruleset Definition and Use. + (line 33) | * prec:postfix: Grammar Rule Definition. + (line 85) | * prec:prefix: Grammar Rule Definition. + (line 36) | * prec:prestfix: Grammar Rule Definition. -* predicate->asso: Association Lists. -* predicate->hash: Hash Tables. -* predicate->hash-asso: Hash Tables. -* present? on base-table: Base Record Operations. | -* pretty-print: Pretty-Print. -* pretty-print->string: Pretty-Print. -* primary-limit on relational-table: Table Administration. | -* prime?: Prime Numbers. -* primes<: Prime Numbers. -* primes>: Prime Numbers. -* print: Yasos interface. -* print-call-stack: Trace. + (line 94) | +* predicate->asso: Association Lists. (line 17) | +* predicate->hash: Hash Tables. (line 9) | +* predicate->hash-asso: Hash Tables. (line 25) | +* present? on base-table: Base Record Operations. + (line 10) | +* pretty-print: Pretty-Print. (line 9) | +* pretty-print->string: Pretty-Print. (line 23) | +* primary-limit on relational-table: Table Administration. + (line 16) | +* prime?: Prime Numbers. (line 28) | +* primes<: Prime Numbers. (line 33) | +* primes>: Prime Numbers. (line 38) | +* print: Yasos interface. (line 36) | +* print-call-stack: Trace. (line 29) | * printf: Standard Formatted Output. -* process:schedule!: Multi-Processing. -* program-vicinity: Vicinity. -* project-table on relational-database: Database Operations. | -* proper-list?: SRFI-1. -* protein<-cdna: NCBI-DNA. | -* provide: Feature. | -* provided?: Feature. -* qp: Quick Print. -* qpn: Quick Print. -* qpr: Quick Print. -* queue-empty?: Queues. -* queue-front: Queues. -* queue-pop!: Queues. -* queue-push!: Queues. -* queue-rear: Queues. -* queue?: Queues. -* random: Exact Random Numbers. | -* random:exp: Inexact Random Numbers. | -* random:hollow-sphere!: Inexact Random Numbers. | -* random:normal: Inexact Random Numbers. | -* random:normal-vector!: Inexact Random Numbers. | -* random:solid-sphere!: Inexact Random Numbers. | -* random:uniform: Inexact Random Numbers. | -* rationalize: Rationalize. -* read-byte: Byte. -* read-bytes: Byte. | -* read-command: Command Line. -* read-line: Line I/O. -* read-line!: Line I/O. -* read-options-file: Command Line. -* receive: SRFI-8. | -* record-accessor: Records. -* record-constructor: Records. -* record-modifier: Records. -* record-predicate: Records. -* reduce <1>: Lists as sequences. -* reduce: Collections. -* reduce-init: Lists as sequences. -* rem: Modular Arithmetic. -* remove <1>: SRFI-1. | -* remove: Lists as sets. -* remove!: SRFI-1. | -* 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. -* replace-suffix: Filenames. -* require <1>: Catalog Creation. | -* require: Require. | -* require-if: Require. | -* resene: Color Names. -* restrict-table on relational-database: Database Operations. | -* reverse!: SRFI-1. -* RGB709->CIEXYZ: Color Conversions. -* rgb709->color: Color Spaces. -* row:delete on relational-table: Single Row Operations. | -* row:delete* on relational-table: Multi-Row Operations. | -* row:insert on relational-table: Single Row Operations. | -* row:insert* on relational-table: Multi-Row Operations. | -* row:remove on relational-table: Single Row Operations. | -* row:remove* on relational-table: Multi-Row Operations. | -* row:retrieve on relational-table: Single Row Operations. | -* row:retrieve* on relational-table: Multi-Row Operations. | -* row:update on relational-table: Single Row Operations. | -* row:update* on relational-table: Multi-Row Operations. | -* rule-horizontal: Legending. | -* rule-vertical: Legending. | -* saturate: Color Names. + (line 9) | +* process:schedule!: Multi-Processing. (line 20) | +* program-vicinity: Vicinity. (line 30) | +* project-table on relational-database: Database Operations. (line 76) | +* proper-list?: SRFI-1. (line 38) | +* protein<-cdna: NCBI-DNA. (line 23) | +* provide: Feature. (line 58) | +* provided?: Feature. (line 30) | +* qp: Quick Print. (line 19) | +* qpn: Quick Print. (line 20) | +* qpr: Quick Print. (line 21) | +* queue-empty?: Queues. (line 19) | +* queue-front: Queues. (line 39) | +* queue-pop!: Queues. (line 29) | +* queue-push!: Queues. (line 22) | +* queue-rear: Queues. (line 42) | +* queue?: Queues. (line 16) | +* random: Exact Random Numbers. + (line 9) | +* random:exp: Inexact Random Numbers. + (line 14) | +* random:hollow-sphere!: Inexact Random Numbers. + (line 32) | +* random:normal: Inexact Random Numbers. + (line 20) | +* random:normal-vector!: Inexact Random Numbers. + (line 26) | +* random:solid-sphere!: Inexact Random Numbers. + (line 39) | +* random:uniform: Inexact Random Numbers. + (line 9) | +* rationalize: Rationalize. (line 9) | +* read-byte: Byte. (line 69) | +* read-bytes: Byte. (line 87) | +* read-cie-illuminant: Spectra. (line 43) | +* read-command: Command Line. (line 9) | +* read-line: Line I/O. (line 9) | +* read-line!: Line I/O. (line 18) | +* read-normalized-illuminant: Spectra. (line 54) | +* read-options-file: Command Line. (line 65) | +* receive: SRFI-8. (line 9) | +* record-accessor: Records. (line 41) | +* record-constructor: Records. (line 22) | +* record-modifier: Records. (line 50) | +* record-predicate: Records. (line 35) | +* reduce <1>: SRFI-1. (line 119) | +* reduce <2>: Lists as sequences. (line 19) | +* reduce: Collections. (line 71) | +* reduce-init: Lists as sequences. (line 61) | +* reduce-right: SRFI-1. (line 120) | +* rem: Modular Arithmetic. (line 10) | +* remove <1>: SRFI-1. (line 135) | +* remove: Lists as sets. (line 153) | +* remove!: SRFI-1. (line 139) | +* remove-duplicates: Lists as sets. (line 199) | +* remove-if: Lists as sets. (line 166) | +* remove-if-not: Lists as sets. (line 177) | +* remove-parameter: Parameter lists. (line 31) | +* remove-setter-for: Setters. (line 49) | +* repl:quit: Repl. (line 17) | +* repl:top-level: Repl. (line 11) | +* replace-suffix: Filenames. (line 65) | +* require <1>: Catalog Creation. (line 48) | +* require: Require. (line 25) | +* require-if: Require. (line 40) | +* resene: Color Names. (line 129) | +* restrict-table on relational-database: Database Operations. (line 77) | +* reverse!: SRFI-1. (line 93) | +* reverse-bit-field: Bit-Twiddling. (line 206) | +* RGB709->CIEXYZ: Color Conversions. (line 30) | +* rgb709->color: Color Spaces. (line 46) | +* rotate-bit-field: Bit-Twiddling. (line 192) | +* row:delete on relational-table: Single Row Operations. + (line 50) | +* row:delete* on relational-table: Multi-Row Operations. + (line 26) | +* row:insert on relational-table: Single Row Operations. + (line 12) | +* row:insert* on relational-table: Multi-Row Operations. + (line 41) | +* row:remove on relational-table: Single Row Operations. + (line 45) | +* row:remove* on relational-table: Multi-Row Operations. + (line 21) | +* row:retrieve on relational-table: Single Row Operations. + (line 37) | +* row:retrieve* on relational-table: Multi-Row Operations. + (line 7) | +* row:update on relational-table: Single Row Operations. + (line 31) | +* row:update* on relational-table: Multi-Row Operations. + (line 47) | +* rule-horizontal: Legending. (line 40) | +* rule-vertical: Legending. (line 32) | +* saturate: Color Names. (line 109) | * scanf: Standard Formatted Input. + (line 13) | * scanf-read-list: Standard Formatted Input. -* scene:overcast: Solid Modeling. -* scene:panorama: Solid Modeling. -* scene:sky-and-dirt: Solid Modeling. -* scene:sky-and-grass: Solid Modeling. -* scene:sphere: Solid Modeling. -* scene:sun: Solid Modeling. -* scene:viewpoint: Solid Modeling. -* scene:viewpoints: Solid Modeling. -* scheme-report-environment: Eval. -* schmooz: Schmooz. -* secant:find-bracketed-root: Root Finding. -* secant:find-root: Root Finding. -* second: SRFI-1. | -* seed->random-state: Exact Random Numbers. | -* set: Setters. -* set-color: Graphics Context. | -* set-difference: Lists as sets. -* set-font: Graphics Context. | -* set-glyphsize: Graphics Context. | -* set-linedash: Graphics Context. | -* set-linewidth: Graphics Context. | -* Setter: Collections. -* setter: Setters. -* setup-plot: Column Ranges. | -* seventh: SRFI-1. -* si:conversion-factor: Metric Units. + (line 9) | +* scene:overcast: Solid Modeling. (line 67) | +* scene:panorama: Solid Modeling. (line 33) | +* scene:sky-and-dirt: Solid Modeling. (line 50) | +* scene:sky-and-grass: Solid Modeling. (line 53) | +* scene:sphere: Solid Modeling. (line 37) | +* scene:sun: Solid Modeling. (line 56) | +* scene:viewpoint: Solid Modeling. (line 81) | +* scene:viewpoints: Solid Modeling. (line 88) | +* scheme-report-environment: Eval. (line 28) | +* schmooz: Schmooz. (line 16) | +* secant:find-bracketed-root: Root Finding. (line 71) | +* secant:find-root: Root Finding. (line 70) | +* second: SRFI-1. (line 55) | +* seed->random-state: Exact Random Numbers. + (line 35) | +* set: Setters. (line 30) | +* set-color: Graphics Context. (line 11) | +* set-difference: Lists as sets. (line 42) | +* set-font: Graphics Context. (line 18) | +* set-glyphsize: Graphics Context. (line 48) | +* set-linedash: Graphics Context. (line 39) | +* set-linewidth: Graphics Context. (line 34) | +* set-margin-templates: Legending. (line 27) | +* Setter: Collections. (line 107) | +* setter: Setters. (line 22) | +* setup-plot: Column Ranges. (line 22) | +* seventh: SRFI-1. (line 63) | +* si:conversion-factor: Metric Units. (line 160) | * singleton-wt-tree: Construction of Weight-Balanced Trees. -* sixth: SRFI-1. -* size <1>: Collections. -* size: Yasos interface. -* sky-color-xyy: Daylight. -* slib:error: System. -* slib:eval: System. -* slib:eval-load: System. -* slib:exit: System. -* slib:in-catalog?: Require. | -* slib:load: System. -* slib:load-compiled: System. -* slib:load-source: System. -* slib:report: Configuration. -* slib:report-version: Configuration. -* slib:warn: System. -* snap-range: Column Ranges. | -* software-type: Configuration. -* solar-declination: Daylight. -* solar-hour: Daylight. -* solar-polar: Daylight. -* solid:arrow: Solid Modeling. -* solid:basrelief: Solid Modeling. -* solid:box: Solid Modeling. -* solid:center-array-of: Solid Modeling. -* solid:center-pile-of: Solid Modeling. -* solid:center-row-of: Solid Modeling. -* solid:color: Solid Modeling. -* solid:cone: Solid Modeling. -* solid:cylinder: Solid Modeling. -* solid:disk: Solid Modeling. -* solid:ellipsoid: Solid Modeling. -* solid:pyramid: Solid Modeling. -* solid:rotation: Solid Modeling. -* solid:scale: Solid Modeling. -* solid:sphere: Solid Modeling. -* solid:texture: Solid Modeling. -* solid:translation: Solid Modeling. | -* solidify-database: Using Databases. -* solidify-database on relational-database: Database Operations. | -* some: Lists as sets. -* sort: Sorting. -* sort!: Sorting. -* sorted?: Sorting. -* soundex: Soundex. -* span: SRFI-1. | -* spectrum->chromaticity: Spectra. -* spectrum->CIEXYZ: Spectra. -* spectrum->XYZ: Spectra. -* split-at: SRFI-1. -* split-at!: SRFI-1. | + (line 58) | +* sixth: SRFI-1. (line 62) | +* size <1>: Collections. (line 104) | +* size: Yasos interface. (line 41) | +* sky-color-xyy: Daylight. (line 85) | +* slib:error: System. (line 45) | +* slib:eval: System. (line 30) | +* slib:eval-load: System. (line 35) | +* slib:exit: System. (line 51) | +* slib:in-catalog?: Require. (line 57) | +* slib:load: System. (line 20) | +* slib:load-compiled: System. (line 15) | +* slib:load-source: System. (line 9) | +* slib:report: Configuration. (line 43) | +* slib:report-version: Configuration. (line 36) | +* slib:warn: System. (line 42) | +* snap-range: Column Ranges. (line 16) | +* software-type: Configuration. (line 32) | +* solar-declination: Daylight. (line 21) | +* solar-hour: Daylight. (line 14) | +* solar-polar: Daylight. (line 23) | +* solid:arrow: Solid Modeling. (line 399) | +* solid:basrelief: Solid Modeling. (line 271) | +* solid:box: Solid Modeling. (line 206) | +* solid:center-array-of: Solid Modeling. (line 390) | +* solid:center-pile-of: Solid Modeling. (line 395) | +* solid:center-row-of: Solid Modeling. (line 386) | +* solid:color: Solid Modeling. (line 313) | +* solid:cone: Solid Modeling. (line 230) | +* solid:cylinder: Solid Modeling. (line 215) | +* solid:disk: Solid Modeling. (line 223) | +* solid:ellipsoid: Solid Modeling. (line 248) | +* solid:font: Solid Modeling. (line 351) | +* solid:polyline: Solid Modeling. (line 257) | +* solid:pyramid: Solid Modeling. (line 236) | +* solid:rotation: Solid Modeling. (line 418) | +* solid:scale: Solid Modeling. (line 414) | +* solid:sphere: Solid Modeling. (line 242) | +* solid:text: Solid Modeling. (line 294) | +* solid:texture: Solid Modeling. (line 330) | +* solid:translation: Solid Modeling. (line 409) | +* solidify-database: Using Databases. (line 86) | +* solidify-database on relational-database: Database Operations. + (line 42) | +* some: Lists as sets. (line 73) | +* sort: Sorting. (line 119) | +* sort!: Sorting. (line 126) | +* sorted?: Sorting. (line 88) | +* soundex: Soundex. (line 9) | +* span: SRFI-1. (line 148) | +* span!: SRFI-1. (line 150) | +* spectrum->chromaticity: Spectra. (line 111) | +* spectrum->XYZ: Spectra. (line 85) | +* split-at: SRFI-1. (line 80) | +* split-at!: SRFI-1. (line 81) | * sprintf: Standard Formatted Output. -* sRGB->CIEXYZ: Color Conversions. -* srgb->color: Color Spaces. -* sRGB->e-sRGB: Color Conversions. -* sRGB->xRGB: Color Conversions. | + (line 11) | +* sRGB->CIEXYZ: Color Conversions. (line 48) | +* srgb->color: Color Spaces. (line 195) | +* sRGB->e-sRGB: Color Conversions. (line 59) | +* sRGB->xRGB: Color Conversions. (line 53) | * sscanf: Standard Formatted Input. -* stack: Trace. -* stack-all: Debug. -* stackf: Trace. | -* string->color: Color Data-Type. -* string->list: Rev4 Optional Procedures. -* string-capitalize: String-Case. -* string-capitalize!: String-Case. | -* string-ci->symbol: String-Case. + (line 15) | +* stack: Trace. (line 49) | +* stack-all: Debug. (line 27) | +* stackf: Trace. (line 85) | +* string->color: Color Data-Type. (line 98) | +* string-capitalize: String-Case. (line 11) | +* string-capitalize!: String-Case. (line 16) | +* string-ci->symbol: String-Case. (line 19) | * string-copy: Rev4 Optional Procedures. -* string-downcase: String-Case. -* string-downcase!: String-Case. + (line 14) | +* string-downcase: String-Case. (line 10) | +* string-downcase!: String-Case. (line 15) | * string-fill!: Rev4 Optional Procedures. -* string-index: String Search. -* string-index-ci: String Search. -* string-join: Batch. -* string-null?: Rev2 Procedures. -* string-reverse-index: String Search. -* string-reverse-index-ci: String Search. -* string-subst: String Search. -* string-upcase: String-Case. -* string-upcase!: String-Case. -* StudlyCapsExpand: String-Case. -* sub-vicinity: Vicinity. -* subarray: Subarrays. -* subarray0: Subarrays. -* subset?: Lists as sets. -* subst: Tree Operations. -* substq: Tree Operations. -* substring-ci?: String Search. -* substring-fill!: Rev2 Procedures. -* substring-move-left!: Rev2 Procedures. -* substring-move-right!: Rev2 Procedures. -* substring-read!: Byte. | -* substring-write: Byte. | -* substring?: String Search. -* substv: Tree Operations. -* sunlight-ciexyz: Daylight. -* sunlight-spectrum: Daylight. -* sunlight-xyz: Daylight. -* supported-key-type? on base-table: Base Field Types. | -* supported-type? on base-table: Base Field Types. | -* symbol-append: String-Case. -* symmetric:modulus: Modular Arithmetic. -* sync-base on base-table: The Base. | -* sync-database: Using Databases. -* sync-database on relational-database: Database Operations. | -* syncase:eval: Syntax-Case Macros. -* syncase:expand: Syntax-Case Macros. -* syncase:load: Syntax-Case Macros. -* syncase:sanity-check: Syntax-Case Macros. | -* synclo:eval: Syntactic Closures. -* synclo:expand: Syntactic Closures. -* synclo:load: Syntactic Closures. -* syntax-rules: Macro by Example. -* system: System Interface. -* system->line: Line I/O. | -* table->linked-html: HTML Tables. -* table->linked-page: HTML Tables. -* table-exists? on relational-database: Database Operations. | -* table-name->filename: HTML Tables. -* take: SRFI-1. -* take!: SRFI-1. | -* take-right: SRFI-1. -* temperature->chromaticity: Spectra. | -* temperature->CIEXYZ: Spectra. -* temperature->XYZ: Spectra. -* tenth: SRFI-1. -* third: SRFI-1. | -* time-zone: Time Zone. -* title-bottom: Legending. | -* title-top: Legending. | -* tmpnam: Input/Output. -* tok:bump-column: Token definition. | -* tok:char-group: Token definition. -* top-refs: Top-level Variable References. | -* top-refs<-file: Top-level Variable References. | -* topological-sort: Topological Sort. -* trace: Trace. -* trace-all: Debug. -* tracef: Trace. -* track: Trace. -* track-all: Debug. -* trackf: Trace. | -* transact-file-replacement: Transactions. -* transcript-off: Transcripts. -* transcript-on: Transcripts. -* transformer: Syntactic Closures. -* transpose: Matrix Algebra. -* truncate-up-to: Batch. -* tsort: Topological Sort. | -* type-of: Type Coercion. -* tz:params: Time Zone. -* tz:std-offset: 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. -* uri:decode-query: URI. -* uri:make-path: URI. | -* uri:path->keys: URI. | -* uri:split-fields: URI. | -* uric:decode: URI. -* uric:encode: URI. -* url->color-dictionary: Color Names. -* user-email-address: Transactions. -* user-vicinity: Vicinity. -* values: Values. -* vector->list: Rev4 Optional Procedures. + (line 16) | +* string-index: String Search. (line 9) | +* string-index-ci: String Search. (line 10) | +* string-join: Batch. (line 123) | +* string-null?: Rev2 Procedures. (line 33) | +* string-reverse-index: String Search. (line 14) | +* string-reverse-index-ci: String Search. (line 15) | +* string-subst: String Search. (line 56) | +* string-upcase: String-Case. (line 9) | +* string-upcase!: String-Case. (line 14) | +* StudlyCapsExpand: String-Case. (line 29) | +* sub-vicinity: Vicinity. (line 73) | +* subarray: Subarrays. (line 9) | +* subset?: Lists as sets. (line 52) | +* subst: Tree Operations. (line 11) | +* substq: Tree Operations. (line 12) | +* substring-ci?: String Search. (line 20) | +* substring-fill!: Rev2 Procedures. (line 30) | +* substring-move-left!: Rev2 Procedures. (line 13) | +* substring-move-right!: Rev2 Procedures. (line 14) | +* substring-read!: Byte. (line 112) | +* substring-write: Byte. (line 121) | +* substring?: String Search. (line 19) | +* substv: Tree Operations. (line 13) | +* sunlight-chromaticity: Daylight. (line 65) | +* sunlight-spectrum: Daylight. (line 61) | +* supported-key-type? on base-table: Base Field Types. (line 13) | +* supported-type? on base-table: Base Field Types. (line 7) | +* symbol-append: String-Case. (line 23) | +* symmetric:modulus: Modular Arithmetic. (line 32) | +* sync-base on base-table: The Base. (line 53) | +* sync-database: Using Databases. (line 82) | +* sync-database on relational-database: Database Operations. (line 37) | +* syncase:eval: Syntax-Case Macros. (line 15) | +* syncase:expand: Syntax-Case Macros. (line 10) | +* syncase:load: Syntax-Case Macros. (line 21) | +* syncase:sanity-check: Syntax-Case Macros. (line 67) | +* synclo:eval: Syntactic Closures. (line 15) | +* synclo:expand: Syntactic Closures. (line 10) | +* synclo:load: Syntactic Closures. (line 21) | +* syntax-rules: Macro by Example. (line 56) | +* system: System Interface. (line 16) | +* system->line: Line I/O. (line 35) | +* table->linked-html: HTML Tables. (line 34) | +* table->linked-page: HTML Tables. (line 42) | +* table-exists? on relational-database: Database Operations. (line 48) | +* table-name->filename: HTML Tables. (line 31) | +* take: SRFI-1. (line 71) | +* take!: SRFI-1. (line 72) | +* take-right: SRFI-1. (line 74) | +* temperature->chromaticity: Spectra. (line 150) | +* temperature->XYZ: Spectra. (line 135) | +* tenth: SRFI-1. (line 66) | +* third: SRFI-1. (line 57) | +* time-zone: Time Zone. (line 68) | +* time:gmtime: Time Infrastructure. (line 9) | +* time:invert: Time Infrastructure. (line 10) | +* time:split: Time Infrastructure. (line 11) | +* title-bottom: Legending. (line 12) | +* title-top: Legending. (line 7) | +* tmpnam: Input/Output. (line 65) | +* tok:bump-column: Token definition. (line 61) | +* tok:char-group: Token definition. (line 7) | +* top-refs: Top-level Variable References. + (line 15) | +* top-refs<-file: Top-level Variable References. + (line 19) | +* topological-sort: Topological Sort. (line 13) | +* trace: Trace. (line 33) | +* trace-all: Debug. (line 19) | +* tracef: Trace. (line 81) | +* track: Trace. (line 41) | +* track-all: Debug. (line 23) | +* trackf: Trace. (line 83) | +* transact-file-replacement: Transactions. (line 98) | +* transcript-off: Transcripts. (line 10) | +* transcript-on: Transcripts. (line 9) | +* transformer: Syntactic Closures. (line 113) | +* transpose: Matrix Algebra. (line 26) | +* truncate-up-to: Batch. (line 113) | +* tsort: Topological Sort. (line 12) | +* type-of: Type Coercion. (line 9) | +* tz:params: Time Zone. (line 73) | +* tz:std-offset: Time Zone. (line 89) | +* tzfile:read: Time Infrastructure. (line 15) | +* tzset: Time Zone. (line 97) | +* unbreak: Breakpoints. (line 37) | +* unbreakf: Breakpoints. (line 58) | +* union: Lists as sets. (line 21) | +* unmake-method!: Object. (line 75) | +* unstack: Trace. (line 71) | +* untrace: Trace. (line 57) | +* untracef: Trace. (line 96) | +* untrack: Trace. (line 64) | +* unzip1: SRFI-1. (line 100) | +* unzip2: SRFI-1. (line 101) | +* unzip3: SRFI-1. (line 102) | +* unzip4: SRFI-1. (line 103) | +* unzip5: SRFI-1. (line 104) | +* uri->tree: URI. (line 47) | +* uri:decode-query: URI. (line 71) | +* uri:make-path: URI. (line 21) | +* uri:path->keys: URI. (line 87) | +* uri:split-fields: URI. (line 67) | +* uric:decode: URI. (line 81) | +* uric:encode: URI. (line 76) | +* url->color-dictionary: Color Names. (line 77) | +* user-email-address: Transactions. (line 133) | +* user-vicinity: Vicinity. (line 47) | +* values: Values. (line 9) | +* vector->array: Arrays. (line 111) | * vector-fill!: Rev4 Optional Procedures. -* vet-slib: Module Analysis. | -* vicinity:suffix?: Vicinity. | -* vrml: Solid Modeling. -* vrml-append: Solid Modeling. -* vrml-to-file: Solid Modeling. -* wavelength->chromaticity: Spectra. -* wavelength->CIEXYZ: Spectra. -* wavelength->XYZ: Spectra. -* whole-page <1>: Rectangles. | -* whole-page: PostScript Graphing. | -* with-input-from-file: With-File. -* with-output-to-file: With-File. -* within-database: Database Macros. -* world:info: Solid Modeling. -* wrap-command-interface: Database Extension. -* write-base on base-table: The Base. | -* write-byte: Byte. -* write-bytes: Byte. | -* write-database: Using Databases. -* write-database on relational-database: Database Operations. | -* write-line: Line I/O. + (line 18) | +* vet-slib: Module Analysis. (line 9) | +* vicinity:suffix?: Vicinity. (line 58) | +* vrml: Solid Modeling. (line 12) | +* vrml-append: Solid Modeling. (line 16) | +* vrml-to-file: Solid Modeling. (line 20) | +* wavelength->chromaticity: Spectra. (line 120) | +* wavelength->XYZ: Spectra. (line 115) | +* whole-page <1>: Rectangles. (line 11) | +* whole-page: PostScript Graphing. (line 37) | +* with-input-from-file: With-File. (line 9) | +* with-load-pathname: Vicinity. (line 79) | +* with-output-to-file: With-File. (line 10) | +* within-database: Within-database. (line 7) | +* world:info: Solid Modeling. (line 24) | +* wrap-command-interface: Database Extension. (line 7) | +* write-base on base-table: The Base. (line 43) | +* write-byte: Byte. (line 62) | +* write-bytes: Byte. (line 98) | +* write-database: Using Databases. (line 79) | +* write-database on relational-database: Database Operations. (line 26) | +* write-line: Line I/O. (line 29) | * wt-tree/add: Basic Operations on Weight-Balanced Trees. + (line 20) | * wt-tree/add!: Basic Operations on Weight-Balanced Trees. + (line 28) | * wt-tree/delete: Basic Operations on Weight-Balanced Trees. + (line 48) | * wt-tree/delete!: Basic Operations on Weight-Balanced Trees. + (line 55) | * wt-tree/delete-min: Indexing Operations on Weight-Balanced Trees. + (line 60) | * wt-tree/delete-min!: Indexing Operations on Weight-Balanced Trees. + (line 70) | * wt-tree/difference: Advanced Operations on Weight-Balanced Trees. + (line 49) | * wt-tree/empty?: Basic Operations on Weight-Balanced Trees. + (line 12) | * wt-tree/fold: Advanced Operations on Weight-Balanced Trees. + (line 91) | * wt-tree/for-each: Advanced Operations on Weight-Balanced Trees. + (line 112) | * wt-tree/index: Indexing Operations on Weight-Balanced Trees. + (line 12) | * wt-tree/index-datum: Indexing Operations on Weight-Balanced Trees. + (line 13) | * wt-tree/index-pair: Indexing Operations on Weight-Balanced Trees. + (line 14) | * wt-tree/intersection: Advanced Operations on Weight-Balanced Trees. + (line 38) | * wt-tree/lookup: Basic Operations on Weight-Balanced Trees. + (line 41) | * wt-tree/member?: Basic Operations on Weight-Balanced Trees. + (line 35) | * wt-tree/min: Indexing Operations on Weight-Balanced Trees. + (line 43) | * wt-tree/min-datum: Indexing Operations on Weight-Balanced Trees. + (line 44) | * wt-tree/min-pair: Indexing Operations on Weight-Balanced Trees. + (line 45) | * wt-tree/rank: Indexing Operations on Weight-Balanced Trees. + (line 35) | * wt-tree/set-equal?: Advanced Operations on Weight-Balanced Trees. + (line 74) | * wt-tree/size: Basic Operations on Weight-Balanced Trees. + (line 16) | * wt-tree/split<: Advanced Operations on Weight-Balanced Trees. + (line 11) | * wt-tree/split>: Advanced Operations on Weight-Balanced Trees. + (line 18) | * wt-tree/subset?: Advanced Operations on Weight-Balanced Trees. + (line 59) | * wt-tree/union: Advanced Operations on Weight-Balanced Trees. -* x-axis: Legending. | -* xcons: SRFI-1. -* xRGB->CIEXYZ: Color Conversions. | -* xrgb->color: Color Spaces. -* xRGB->sRGB: Color Conversions. | -* xyY->XYZ: Spectra. -* xyY:normalize-colors: Spectra. -* XYZ->chromaticity: Spectra. -* XYZ->xyY: Spectra. -* XYZ:normalize: Spectra. -* XYZ:normalize-colors: Spectra. -* y-axis: Legending. | -* zenith-xyy: Daylight. -* zip: SRFI-1. + (line 25) | +* x-axis: Legending. (line 51) | +* xcons: SRFI-1. (line 15) | +* xRGB->CIEXYZ: Color Conversions. (line 51) | +* xrgb->color: Color Spaces. (line 215) | +* xRGB->sRGB: Color Conversions. (line 54) | +* xyY->XYZ: Spectra. (line 188) | +* xyY:normalize-colors: Spectra. (line 190) | +* XYZ->chromaticity: Spectra. (line 165) | +* XYZ->xyY: Spectra. (line 184) | +* y-axis: Legending. (line 48) | +* zenith-xyy: Daylight. (line 70) | +* zip: SRFI-1. (line 98) | Variable Index ************** This is an alphabetical list of all the global variables in SLIB. + * Menu: -* *argv*: Getopt. -* *base-table-implementations*: Base Table. -* *catalog*: Require. | -* *http:byline*: HTTP and CGI. | -* *operating-system*: Batch. -* *optarg*: Getopt. -* *optind*: Getopt. -* *qp-width*: Quick Print. -* *random-state*: Exact Random Numbers. | -* *ruleset*: Commutative Rings. +* *argv*: Getopt. (line 25) | +* *base-table-implementations*: Base Table. (line 52) | +* *catalog*: Require. (line 10) | +* *http:byline*: HTTP and CGI. (line 17) | +* *operating-system*: Batch. (line 41) | +* *optarg*: Getopt. (line 35) | +* *optind*: Getopt. (line 30) | +* *qp-width*: Quick Print. (line 28) | +* *random-state*: Exact Random Numbers. + (line 21) | +* *ruleset*: Commutative Rings. (line 76) | * *syn-defs*: Ruleset Definition and Use. + (line 7) | * *syn-ignore-whitespace*: Ruleset Definition and Use. -* *timezone*: Time Zone. -* atm-hec-polynomial: Cyclic Checksum. -* bottomedge: Legending. | -* char-code-limit: Configuration. -* charplot:dimensions: Character Plotting. | -* CIEXYZ:A: Color Conversions. -* CIEXYZ:B: Color Conversions. -* CIEXYZ:C: Color Conversions. -* CIEXYZ:D50: Color Conversions. -* CIEXYZ:D65: Color Conversions. -* CIEXYZ:E: Color Conversions. | -* crc-08-polynomial: Cyclic Checksum. -* crc-10-polynomial: Cyclic Checksum. -* crc-12-polynomial: Cyclic Checksum. -* crc-16-polynomial: Cyclic Checksum. -* crc-32-polynomial: Cyclic Checksum. -* crc-ccitt-polynomial: Cyclic Checksum. -* D50: Color Data-Type. -* D65: Color Data-Type. -* daylight?: Time Zone. -* debug:max-count: Trace. -* distribute*: Commutative Rings. -* distribute/: Commutative Rings. -* dowcrc-polynomial: Cyclic Checksum. -* graph:dimensions: Legacy Plotting. | -* graphrect: Rectangles. | -* leftedge: Legending. | -* most-positive-fixnum: Configuration. -* nil: Miscellany. + (line 12) | +* *timezone*: Time Zone. (line 111) | +* atm-hec-polynomial: Cyclic Checksum. (line 115) | +* bottomedge: Legending. (line 18) | +* char-code-limit: Configuration. (line 11) | +* charplot:dimensions: Character Plotting. (line 9) | +* CIEXYZ:A: Color Conversions. (line 21) | +* CIEXYZ:B: Color Conversions. (line 22) | +* CIEXYZ:C: Color Conversions. (line 23) | +* CIEXYZ:D50: Color Conversions. (line 17) | +* CIEXYZ:D65: Color Conversions. (line 13) | +* CIEXYZ:E: Color Conversions. (line 24) | +* crc-08-polynomial: Cyclic Checksum. (line 109) | +* crc-10-polynomial: Cyclic Checksum. (line 98) | +* crc-12-polynomial: Cyclic Checksum. (line 77) | +* crc-16-polynomial: Cyclic Checksum. (line 69) | +* crc-32-polynomial: Cyclic Checksum. (line 45) | +* crc-ccitt-polynomial: Cyclic Checksum. (line 61) | +* D50: Color Data-Type. (line 120) | +* D65: Color Data-Type. (line 116) | +* daylight?: Time Zone. (line 117) | +* debug:max-count: Trace. (line 24) | +* distribute*: Commutative Rings. (line 100) | +* distribute/: Commutative Rings. (line 104) | +* dowcrc-polynomial: Cyclic Checksum. (line 120) | +* graph:dimensions: Legacy Plotting. (line 7) | +* graphrect: Rectangles. (line 26) | +* leftedge: Legending. (line 22) | +* most-positive-fixnum: Configuration. (line 15) | +* nil: Miscellany. (line 70) | * number-wt-type: Construction of Weight-Balanced Trees. -* plotrect: Rectangles. | -* prime:prngs: Prime Numbers. -* prime:trials: Prime Numbers. -* rightedge: Legending. | -* slib:form-feed: Configuration. -* slib:tab: Configuration. + (line 39) | +* plotrect: Rectangles. (line 22) | +* prime:prngs: Prime Numbers. (line 9) | +* prime:trials: Prime Numbers. (line 24) | +* rightedge: Legending. (line 23) | +* slib:form-feed: Configuration. (line 29) | +* slib:tab: Configuration. (line 26) | * stderr: Standard Formatted I/O. + (line 25) | * stdin: Standard Formatted I/O. + (line 19) | * stdout: Standard Formatted I/O. + (line 22) | * string-wt-type: Construction of Weight-Balanced Trees. -* t: Miscellany. -* tok:decimal-digits: Token definition. -* tok:lower-case: Token definition. -* tok:upper-case: Token definition. -* tok:whitespaces: Token definition. -* topedge: Legending. | -* tzname: Time Zone. -* usb-token-polynomial: Cyclic Checksum. + (line 45) | +* subarray0: Subarrays. (line 41) | +* t: Miscellany. (line 67) | +* tok:decimal-digits: Token definition. (line 41) | +* tok:lower-case: Token definition. (line 48) | +* tok:upper-case: Token definition. (line 44) | +* tok:whitespaces: Token definition. (line 52) | +* topedge: Legending. (line 17) | +* tzname: Time Zone. (line 123) | +* usb-token-polynomial: Cyclic Checksum. (line 124) | Concept and Feature Index ************************* + * Menu: -* aggregate <1>: Module Semantics. | -* aggregate: Library Catalogs. | -* alarm: Multi-Processing. | -* alarm-interrupt: Multi-Processing. | -* alist: Association Lists. +* aggregate <1>: Module Semantics. (line 20) | +* aggregate: Library Catalogs. (line 24) | +* alarm: Multi-Processing. (line 10) | +* alarm-interrupt: Multi-Processing. (line 10) | +* alist: Association Lists. (line 6) | * alist-table <1>: Relational Database Objects. -* alist-table <2>: The Base. | -* alist-table: Base Table. -* ange-ftp: URI. -* appearance: Solid Modeling. -* array: Arrays. -* array-for-each: Array Mapping. -* association function: Association Lists. | -* attribute-value: HTML. -* Auto-sharing: Using Databases. + (line 23) | +* alist-table <2>: The Base. (line 12) | +* alist-table: Base Table. (line 16) | +* ange-ftp: URI. (line 118) | +* appearance: Solid Modeling. (line 320) | +* array: Arrays. (line 6) | +* array-for-each: Array Mapping. (line 6) | +* association function: Association Lists. (line 17) | +* attribute-value: HTML. (line 10) | +* Auto-sharing: Using Databases. (line 25) | * balanced binary trees: Weight-Balanced Trees. -* base: URI. -* base-table: Base Table. -* batch: Batch. -* binary: Byte. + (line 8) | +* base: URI. (line 39) | +* base-table: Base Table. (line 6) | +* batch: Batch. (line 6) | +* binary: Byte. (line 56) | * binary trees: Weight-Balanced Trees. + (line 8) | * binary trees, as discrete maps: Weight-Balanced Trees. + (line 52) | * binary trees, as sets: Weight-Balanced Trees. + (line 52) | * binding power: Precedence Parsing Overview. -* break: Breakpoints. -* byte: Byte. -* byte-number: Byte/Number Conversions. | -* calendar time <1>: Posix Time. -* calendar time: Time and Date. -* Calendar-Time: Posix Time. -* caltime: Posix Time. -* canonical: Color Names. -* careful: Commutative Rings. -* catalog: Require. | -* Catalog File: Library Catalogs. -* certificate: Transactions. -* cgi: HTTP and CGI. -* chapter-order: Chapter Ordering. -* charplot: Character Plotting. | -* Chroma: Color Spaces. -* cie1931: Spectra. -* cie1964: Spectra. -* ciexyz: Spectra. -* CIEXYZ: Color Spaces. -* cksum-string: Cyclic Checksum. | -* coerce: Type Coercion. -* collect: Collections. -* color-database: Color Names. | -* color-names: Color Names. | -* command line: Command Line. -* commentfix: Rule Types. + (line 22) | +* break: Breakpoints. (line 6) | +* byte: Byte. (line 6) | +* byte-number: Byte/Number Conversions. + (line 6) | +* calendar time <1>: Posix Time. (line 10) | +* calendar time: Time and Date. (line 16) | +* Calendar-Time: Posix Time. (line 10) | +* caltime: Posix Time. (line 10) | +* canonical: Color Names. (line 16) | +* careful: Commutative Rings. (line 14) | +* catalog: Require. (line 6) | +* Catalog File: Library Catalogs. (line 6) | +* certificate: Transactions. (line 36) | +* cgi: HTTP and CGI. (line 6) | +* chapter-order: Chapter Ordering. (line 6) | +* charplot: Character Plotting. (line 6) | +* Chroma: Color Spaces. (line 141) | +* cie1931: Spectra. (line 31) | +* cie1964: Spectra. (line 27) | +* ciexyz: Spectra. (line 35) | +* CIEXYZ: Color Spaces. (line 18) | +* cksum-string: Cyclic Checksum. (line 160) | +* coerce: Type Coercion. (line 6) | +* collect: Collections. (line 6) | +* color-database: Color Names. (line 65) | +* color-names: Color Names. (line 6) | +* command line: Command Line. (line 10) | +* commentfix: Rule Types. (line 35) | * common-list-functions <1>: Common List Functions. -* common-list-functions: Collections. -* commutative-ring: Commutative Rings. -* compiled: Library Catalogs. | -* compiling: Module Conventions. | -* Coordinated Universal Time: Posix Time. -* copyright: Copyrights. -* crc: Cyclic Checksum. -* cvs: CVS. -* database-commands: Command Example. -* databases <1>: Command Example. + (line 6) | +* common-list-functions: Collections. (line 74) | +* commutative-ring: Commutative Rings. (line 11) | +* compiled: Library Catalogs. (line 21) | +* compiling: Module Conventions. (line 11) | +* Coordinated Universal Time: Posix Time. (line 13) | +* copyright: Copyrights. (line 6) | +* crc: Cyclic Checksum. (line 6) | +* cvs: CVS. (line 6) | +* database-commands: Command Example. (line 10) | +* databases <1>: Command Example. (line 11) | * databases <2>: Define-tables Example. -* databases <3>: Using Databases. -* databases: Batch. -* daylight: Daylight. -* db->html: HTML Tables. | -* debug <1>: Breakpoints. -* debug: Debug. -* defmacro: Library Catalogs. | -* defmacroexpand <1>: Pretty-Print. -* defmacroexpand: Defmacro. -* delim: Rule Types. -* dequeues: Queues. | -* determinant: Matrix Algebra. | -* diff: Sequence Comparison. -* directory: Directories. | -* Discrete Fourier Transform: Fast Fourier Transform. | + (line 12) | +* databases <3>: Using Databases. (line 6) | +* databases: Batch. (line 145) | +* daylight: Daylight. (line 6) | +* db->html: HTML Tables. (line 6) | +* debug <1>: Breakpoints. (line 11) | +* debug: Debug. (line 6) | +* defmacro: Library Catalogs. (line 31) | +* defmacroexpand <1>: Pretty-Print. (line 88) | +* defmacroexpand: Defmacro. (line 48) | +* delim: Rule Types. (line 47) | +* dequeues: Queues. (line 10) | +* determinant: Matrix Algebra. (line 6) | +* diff: Sequence Comparison. (line 6) | +* directory: Directories. (line 6) | +* Discrete Fourier Transform: Fast Fourier Transform. + (line 11) | * discrete maps, using binary trees: Weight-Balanced Trees. -* DrScheme: Installation. -* dynamic: Dynamic Data Type. -* dynamic-wind: Dynamic-Wind. -* e-sRGB: Color Spaces. -* emacs: Transactions. -* Encapsulated-PostScript: PostScript Graphing. | -* escaped: URI. -* Euclidean Domain: Commutative Rings. -* eval: Eval. -* exchanger: Miscellany. -* factor: Prime Numbers. -* feature <1>: About this manual. -* feature <2>: Require. | -* feature: Feature. + (line 52) | +* DrScheme: Installation. (line 103) | +* dynamic: Dynamic Data Type. (line 6) | +* dynamic-wind: Dynamic-Wind. (line 6) | +* e-sRGB: Color Spaces. (line 218) | +* emacs: Transactions. (line 33) | +* Encapsulated-PostScript: PostScript Graphing. (line 23) | +* escaped: URI. (line 77) | +* EUC: Extra-SLIB Packages. (line 53) | +* Euclidean Domain: Commutative Rings. (line 67) | +* eval: Eval. (line 6) | +* exchanger: Miscellany. (line 31) | +* factor: Prime Numbers. (line 6) | +* feature <1>: About this manual. (line 13) | +* feature <2>: Require. (line 18) | +* feature: Feature. (line 6) | * fft: Fast Fourier Transform. -* File Transfer Protocol: URI. -* file-lock: Transactions. -* filename: Filenames. -* fluid-let: Fluid-Let. -* form: HTML. -* format: Format. -* gamut: Color Spaces. -* generic-write: Generic-Write. -* getit: URI. -* getopt <1>: Command Example. -* getopt: Getopt. -* getopt-parameters <1>: Command Example. + (line 6) | +* File Transfer Protocol: URI. (line 113) | +* file-lock: Transactions. (line 32) | +* filename: Filenames. (line 6) | +* fluid-let: Fluid-Let. (line 6) | +* form: HTML. (line 63) | +* format: Format. (line 6) | +* Gambit-C: Installation. (line 116) | +* gamut: Color Spaces. (line 18) | +* generic-write: Generic-Write. (line 6) | +* getit: URI. (line 118) | +* getopt <1>: Command Example. (line 14) | +* getopt: Getopt. (line 6) | +* getopt-parameters <1>: Command Example. (line 12) | * getopt-parameters: Getopt Parameter lists. -* glob <1>: Batch. -* glob: Filenames. -* Gray code: Bit-Twiddling. -* Guile: Installation. -* hash: Hashing. -* hash-table: Hash Tables. -* Hilbert: Peano-Hilbert Space-Filling Curve. -* hilbert-fill: Peano-Hilbert Space-Filling Curve. -* HOME <1>: Vicinity. -* HOME: Catalog Creation. | -* homecat: Catalog Vicinities. | -* html-for-each: Parsing HTML. -* html-form: HTML. -* http: HTTP and CGI. -* Hue: Color Spaces. -* ICC Profile: Color Spaces. -* implcat: Catalog Vicinities. | -* indexed-sequential-access-method: Byte/Number Conversions. | -* infix: Rule Types. -* Info: Top-level Variable References. | -* inmatchfix: Rule Types. -* install: Installation. | -* installation: Installation. | -* intrinsic feature: Feature. | -* ISAM: Indexed Sequential Access Methods. | -* L*a*b*: Color Spaces. -* L*C*h: Color Spaces. -* L*u*v*: Color Spaces. + (line 6) | +* glob <1>: Batch. (line 148) | +* glob: Filenames. (line 6) | +* Gray code: Hilbert Space-Filling Curve. | + (line 52) | +* Guile: Installation. (line 119) | +* hash: Hashing. (line 6) | +* hash-table: Hash Tables. (line 6) | +* Hilbert: Hilbert Space-Filling Curve. | + (line 8) | +* Hilbert Space-Filling Curve: Hilbert Space-Filling Curve. | + (line 8) | +* hilbert-fill: Hilbert Space-Filling Curve. | + (line 6) | +* HOME <1>: Vicinity. (line 51) | +* HOME: Catalog Creation. (line 19) | +* homecat: Catalog Vicinities. (line 35) | +* html-for-each: Parsing HTML. (line 6) | +* html-form: HTML. (line 6) | +* http: HTTP and CGI. (line 6) | +* Hue: Color Spaces. (line 143) | +* ICC Profile: Color Spaces. (line 191) | +* implcat: Catalog Vicinities. (line 23) | +* indexed-sequential-access-method: Byte/Number Conversions. + (line 120) | +* infix: Rule Types. (line 19) | +* Info: Top-level Variable References. + (line 32) | +* inmatchfix: Rule Types. (line 43) | +* install: Installation. (line 6) | +* installation: Installation. (line 6) | +* intrinsic feature: Feature. (line 9) | +* ISAM: Indexed Sequential Access Methods. + (line 6) | +* Japanese: Extra-SLIB Packages. (line 53) | +* JFILTER: Extra-SLIB Packages. (line 53) | +* JIS: Extra-SLIB Packages. (line 53) | +* L*a*b*: Color Spaces. (line 68) | +* L*C*h: Color Spaces. (line 135) | +* L*u*v*: Color Spaces. (line 98) | +* lamination: Hilbert Space-Filling Curve. | + (line 88) | * Left Denotation, led: Nud and Led Definition. -* Lightness: Color Spaces. -* line-i: Line I/O. -* list-processing library: SRFI-1. -* load-option: Weight-Balanced Trees. | -* logical: Bit-Twiddling. -* macro <1>: Repl. -* macro <2>: R4RS Macros. | -* macro: Library Catalogs. | -* macro-by-example <1>: Macro by Example. | -* macro-by-example: Library Catalogs. | -* macros-that-work <1>: Macros That Work. | -* macros-that-work: Library Catalogs. | -* manifest: Module Manifests. | -* match: Match Keys. | -* match-keys <1>: Match Keys. | -* match-keys: Match-Keys. | -* matchfix: Rule Types. -* matfile: MAT-File Format. -* matlab: MAT-File Format. -* metric-units: Metric Units. -* minimize: Minimizing. + (line 13) | +* Lightness: Color Spaces. (line 71) | +* line-i: Line I/O. (line 6) | +* list-processing library: SRFI-1. (line 8) | +* load-option: Weight-Balanced Trees. + (line 73) | +* logical: Bit-Twiddling. (line 6) | +* macro <1>: Repl. (line 32) | +* macro <2>: R4RS Macros. (line 6) | +* macro: Library Catalogs. (line 37) | +* macro-by-example <1>: Macro by Example. (line 6) | +* macro-by-example: Library Catalogs. (line 34) | +* macros-that-work <1>: Macros That Work. (line 6) | +* macros-that-work: Library Catalogs. (line 40) | +* manifest: Module Manifests. (line 6) | +* match: Match Keys. (line 6) | +* match-keys <1>: Match Keys. (line 6) | +* match-keys: Match-Keys. (line 6) | +* matchfix: Rule Types. (line 39) | +* matfile: MAT-File Format. (line 6) | +* matlab: MAT-File Format. (line 6) | +* metric-units: Metric Units. (line 6) | +* minimize: Minimizing. (line 6) | * minimum field width (printf): Standard Formatted Output. -* MIT Scheme: Installation. -* mkimpcat.scm: Catalog Vicinities. | -* mklibcat.scm: Catalog Vicinities. | -* modular: Modular Arithmetic. + (line 88) | +* MIT Scheme: Installation. (line 113) | +* mkimpcat.scm: Catalog Vicinities. (line 28) | +* mklibcat.scm: Catalog Vicinities. (line 16) | +* modular: Modular Arithmetic. (line 6) | * multiarg: Multi-argument / and -. + (line 6) | * multiarg-apply: Multi-argument Apply. -* MzScheme: Installation. -* nary: Rule Types. -* new-catalog: Catalog Creation. | -* nofix: Rule Types. -* null: HTML Tables. + (line 6) | +* MzScheme: Installation. (line 104) | +* nary: Rule Types. (line 23) | +* new-catalog: Catalog Creation. (line 48) | +* nofix: Rule Types. (line 11) | +* null: HTML Tables. (line 92) | * Null Denotation, nud: Nud and Led Definition. -* object: Object. -* object->string: Object-To-String. -* oop: Yasos. + (line 9) | +* object: Object. (line 6) | +* object->string: Object-To-String. (line 6) | +* oop: Yasos. (line 6) | * option, run-time-loadable: Weight-Balanced Trees. -* options file: Command Line. -* parameters <1>: Command Example. -* parameters <2>: Batch. -* parameters: Parameter lists. -* parse: Precedence Parsing. + (line 69) | +* options file: Command Line. (line 65) | +* parameters <1>: Command Example. (line 13) | +* parameters <2>: Batch. (line 146) | +* parameters: Parameter lists. (line 6) | +* parse: Precedence Parsing. (line 6) | * pbm: Portable Image Files. + (line 22) | * pbm-raw: Portable Image Files. -* Peano: Peano-Hilbert Space-Filling Curve. -* Peano-Hilbert Space-Filling Curve: Peano-Hilbert Space-Filling Curve. + (line 22) | * pgm: Portable Image Files. + (line 26) | * pgm-raw: Portable Image Files. -* plain-text: HTML. -* PLT Scheme: Installation. -* pnm: Portable Image Files. | -* portable bitmap graphics: Portable Image Files. | -* posix-time: Posix Time. -* postfix: Rule Types. + (line 26) | +* plain-text: HTML. (line 14) | +* PLT Scheme: Installation. (line 102) | +* pnm: Portable Image Files. + (line 6) | +* portable bitmap graphics: Portable Image Files. + (line 9) | +* posix-time: Posix Time. (line 7) | +* postfix: Rule Types. (line 27) | * ppm: Portable Image Files. + (line 31) | * ppm-raw: Portable Image Files. -* pprint-file: Pretty-Print. -* PRE: HTML. -* precedence: Precedence Parsing. + (line 31) | +* pprint-file: Pretty-Print. (line 60) | +* PRE: HTML. (line 50) | +* precedence: Precedence Parsing. (line 6) | * precision (printf): Standard Formatted Output. -* prefix: Rule Types. -* prestfix: Rule Types. -* pretty-print: Pretty-Print. -* primes: Prime Numbers. + (line 101) | +* prefix: Rule Types. (line 15) | +* prestfix: Rule Types. (line 31) | +* pretty-print: Pretty-Print. (line 6) | +* primes: Prime Numbers. (line 6) | * printf: Standard Formatted Output. -* priority-queue: Priority Queues. -* PRNG: Random Numbers. -* process: Multi-Processing. -* promise: Promises. -* qp <1>: Quick Print. -* qp: Getopt. -* query-string: HTTP and CGI. -* queue: Queues. -* r2rs: RnRS. -* r3rs <1>: Coding Guidelines. | -* r3rs: RnRS. -* r4rs: RnRS. -* r5rs: RnRS. -* random: Exact Random Numbers. | -* random-inexact: Inexact Random Numbers. | -* range: Column Ranges. | -* rationalize: Rationalize. -* read-command: Command Line. -* record: Records. -* rectangle: Rectangles. | -* relational-database: Relational Database. -* relational-system: Using Databases. | -* repl <1>: Repl. -* repl: Syntax-Case Macros. -* resene: Color Names. -* Resene: Color Names. -* reset: HTML. -* rev2-procedures: Rev2 Procedures. | + (line 6) | +* priority-queue: Priority Queues. (line 6) | +* PRNG: Random Numbers. (line 6) | +* process: Multi-Processing. (line 6) | +* Prolog: Extra-SLIB Packages. (line 49) | +* promise: Promises. (line 6) | +* PSD: Extra-SLIB Packages. (line 26) | +* qp <1>: Quick Print. (line 6) | +* qp: Getopt. (line 146) | +* query-string: HTTP and CGI. (line 36) | +* queue: Queues. (line 6) | +* r2rs: RnRS. (line 11) | +* r3rs <1>: Coding Guidelines. (line 10) | +* r3rs: RnRS. (line 16) | +* r4rs: RnRS. (line 24) | +* r5rs: RnRS. (line 29) | +* random: Exact Random Numbers. + (line 6) | +* random-inexact: Inexact Random Numbers. + (line 6) | +* range: Column Ranges. (line 6) | +* rationalize: Rationalize. (line 6) | +* read-command: Command Line. (line 6) | +* record: Records. (line 6) | +* rectangle: Rectangles. (line 6) | +* relational-database: Relational Database. (line 6) | +* relational-system: Using Databases. (line 53) | +* repl <1>: Repl. (line 6) | +* repl: Syntax-Case Macros. (line 61) | +* resene: Color Names. (line 126) | +* Resene: Color Names. (line 95) | +* reset: HTML. (line 95) | +* rev2-procedures: Rev2 Procedures. (line 6) | * rev4-optional-procedures: Rev4 Optional Procedures. -* RGB709: Color Spaces. -* ring, commutative: Commutative Rings. -* RNG: Random Numbers. -* root: Root Finding. + (line 6) | +* RGB709: Color Spaces. (line 37) | +* ring, commutative: Commutative Rings. (line 11) | +* RNG: Random Numbers. (line 6) | +* root: Root Finding. (line 6) | * run-time-loadable option: Weight-Balanced Trees. -* rwb-isam: Base Table. | -* saturate: Color Names. + (line 69) | +* rwb-isam: Base Table. (line 39) | +* saturate: Color Names. (line 95) | * scanf: Standard Formatted Input. -* scheme: URI. -* 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. + (line 6) | +* SCHELOG: Extra-SLIB Packages. (line 49) | +* scheme: URI. (line 99) | +* Scheme Request For Implementation: SRFI. (line 8) | +* Scheme48: Installation. (line 137) | +* schmooz: Schmooz. (line 6) | +* SCM: Installation. (line 97) | +* script: Installation. (line 37) | +* self-set: Commutative Rings. (line 17) | +* Sequence Comparison: Sequence Comparison. (line 6) | +* Server-based Naming Authority: URI. (line 58) | +* session: Feature. (line 7) | * sets, using binary trees: Weight-Balanced Trees. -* shell: Command Line. | -* sierpinski: Sierpinski Curve. -* sitecat: Catalog Vicinities. | -* sky: Daylight. -* slibcat: Catalog Vicinities. | -* solid: Solid Modeling. -* solid-modeling: Solid Modeling. -* solids: Solid Modeling. -* sort: Sorting. -* soundex: Soundex. -* source: Library Catalogs. | -* Space-Filling: Peano-Hilbert Space-Filling Curve. -* sparse: MAT-File Format. -* Spectral Tristimulus Values: Spectra. -* spiff: Sequence Comparison. -* srfi: SRFI. -* SRFI-1: SRFI-1. -* srfi-1: SRFI-1. -* srfi-2: SRFI-2. | -* srfi-8: SRFI-8. | -* srfi-9: SRFI-9. | -* sRGB: Color Spaces. + (line 52) | +* shell: Command Line. (line 12) | +* sierpinski: Sierpinski Curve. (line 6) | +* sitecat: Catalog Vicinities. (line 19) | +* sky: Daylight. (line 6) | +* slib: Installation. (line 37) | +* slibcat: Catalog Vicinities. (line 11) | +* solid: Solid Modeling. (line 6) | +* solid-modeling: Solid Modeling. (line 6) | +* solids: Solid Modeling. (line 6) | +* sort: Sorting. (line 6) | +* soundex: Soundex. (line 6) | +* source: Library Catalogs. (line 18) | +* Space-Filling: Hilbert Space-Filling Curve. | + (line 8) | +* sparse: MAT-File Format. (line 15) | +* Spectral Tristimulus Values: Spectra. (line 24) | +* spiff: Sequence Comparison. (line 29) | +* srfi: SRFI. (line 6) | +* SRFI-1: SRFI-1. (line 8) | +* srfi-1: SRFI-1. (line 6) | +* srfi-2: SRFI-2. (line 6) | +* srfi-8: SRFI-8. (line 6) | +* srfi-9: SRFI-9. (line 6) | +* sRGB: Color Spaces. (line 189) | * stdio: Standard Formatted I/O. -* string-case: String-Case. -* string-port: String Ports. -* string-search: String Search. -* subarray: Subarrays. -* sun: Daylight. -* sunlight: Daylight. -* symmetric: Modular Arithmetic. | -* syntactic-closures <1>: Syntactic Closures. | -* syntactic-closures: Library Catalogs. | + (line 14) | +* string-case: String-Case. (line 6) | +* string-port: String Ports. (line 6) | +* string-search: String Search. (line 6) | +* subarray: Subarrays. (line 6) | +* sun: Daylight. (line 6) | +* sunlight: Daylight. (line 6) | +* symmetric: Modular Arithmetic. (line 54) | +* syntactic-closures <1>: Syntactic Closures. (line 6) | +* syntactic-closures: Library Catalogs. (line 46) | * syntax tree: Precedence Parsing Overview. -* syntax-case <1>: Syntax-Case Macros. | -* syntax-case: Library Catalogs. | -* time: Time and Date. -* time-zone: Time Zone. -* top-level variable references: Top-level Variable References. | -* top-refs: Top-level Variable References. | -* topological-sort: Topological Sort. -* trace: Trace. -* transact: Transactions. -* transcript: Transcripts. -* tree: Tree Operations. + (line 32) | +* syntax-case <1>: Syntax-Case Macros. (line 6) | +* syntax-case: Library Catalogs. (line 43) | +* time: Time and Date. (line 16) | +* time-zone: Time Zone. (line 63) | +* top-level variable references: Top-level Variable References. + (line 6) | +* top-refs: Top-level Variable References. + (line 6) | +* topological-sort: Topological Sort. (line 6) | +* trace: Trace. (line 6) | +* transact: Transactions. (line 10) | +* transcript: Transcripts. (line 6) | +* tree: Tree Operations. (line 6) | * trees, balanced binary: Weight-Balanced Trees. -* tristimulus: Color Spaces. -* tsort: Topological Sort. -* turbidity: Daylight. -* TZ-string: Time Zone. -* Uniform Resource Identifiers: URI. -* Uniform Resource Locator: URI. -* Unique Factorization: Commutative Rings. -* unsafe: URI. -* URI: URI. -* uri: URI. -* URI: HTTP and CGI. -* usercat: Catalog Vicinities. | -* UTC: Posix Time. -* values: Values. -* variable references: Top-level Variable References. | -* vet: Module Analysis. | -* VSCM: Installation. -* WB: Base Table. -* wb-table: Base Table. + (line 8) | +* tristimulus: Color Spaces. (line 9) | +* tsort: Topological Sort. (line 6) | +* turbidity: Daylight. (line 31) | +* TZ-string: Time Zone. (line 9) | +* Uniform Resource Identifiers: URI. (line 8) | +* Uniform Resource Locator: URI. (line 118) | +* Unique Factorization: Commutative Rings. (line 67) | +* unsafe: URI. (line 77) | +* URI: URI. (line 71) | +* uri: URI. (line 6) | +* URI: HTTP and CGI. (line 36) | +* usercat: Catalog Vicinities. (line 38) | +* UTC: Posix Time. (line 13) | +* values: Values. (line 6) | +* variable references: Top-level Variable References. + (line 6) | +* vet: Module Analysis. (line 6) | +* VSCM: Installation. (line 148) | +* WB: Base Table. (line 34) | +* wb-table: Base Table. (line 32) | * weight-balanced binary trees: Weight-Balanced Trees. -* wget: Color Names. -* white point: Color Data-Type. -* wild-card: Match Keys. | -* with-file: With-File. -* Word: Transactions. + (line 8) | +* wget: Color Names. (line 81) | +* white point: Color Data-Type. (line 107) | +* wild-card: Match Keys. (line 6) | +* with-file: With-File. (line 6) | +* Word: Transactions. (line 34) | * wt-tree: Weight-Balanced Trees. -* xRGB: Color Spaces. -* xyY: Spectra. -* yasos: Yasos. + (line 6) | +* xRGB: Color Spaces. (line 204) | +* xyY: Spectra. (line 175) | +* yasos: Yasos. (line 6) | Tag Table: -Node: Top1038 -Node: The Library System1832 -Node: Feature2447 -Node: Require5817 -Node: Library Catalogs9665 -Node: Catalog Creation11330 -Node: Catalog Vicinities14797 -Node: Compiling Scheme19397 -Node: Module Conventions20721 -Ref: Module Conventions-Footnote-115614 -Node: Module Manifests23491 -Node: Module Semantics32652 -Node: Top-level Variable References35341 -Ref: Top-level Variable References-Footnote-124139 -Node: Module Analysis39789 -Node: Universal SLIB Procedures42532 -Node: Vicinity43862 -Node: Configuration47550 -Node: Input/Output50710 -Node: System54238 -Node: Miscellany57523 -Node: Scheme Syntax Extension Packages59694 -Node: Defmacro60439 -Node: R4RS Macros62386 -Node: Macro by Example63639 -Node: Macros That Work66514 -Node: Syntactic Closures72567 -Node: Syntax-Case Macros89995 -Node: Fluid-Let94454 -Node: Yasos95393 -Node: Yasos terms96184 -Node: Yasos interface97208 -Node: Setters99283 -Node: Yasos examples101923 -Node: Textual Conversion Packages104922 -Node: Precedence Parsing105719 -Node: Precedence Parsing Overview106395 -Ref: Precedence Parsing Overview-Footnote-188500 -Node: Rule Types108019 -Node: Ruleset Definition and Use109452 -Node: Token definition111816 -Node: Nud and Led Definition114725 -Node: Grammar Rule Definition117172 -Node: Format124746 -Node: Standard Formatted I/O125156 -Node: Standard Formatted Output125720 -Node: Standard Formatted Input135110 -Node: Programs and Arguments141768 -Node: Getopt142268 -Node: Command Line148891 -Node: Parameter lists152078 -Node: Getopt Parameter lists155963 -Node: Filenames159199 -Node: Batch163646 -Node: HTML171449 -Node: HTML Tables178112 -Node: HTTP and CGI184553 -Node: Parsing HTML189090 -Node: URI191584 -Node: Printing Scheme196704 -Node: Generic-Write197013 -Node: Object-To-String198414 -Node: Pretty-Print198816 -Node: Time and Date201777 -Node: Time Zone202797 -Node: Posix Time207756 -Node: Common-Lisp Time209892 -Node: NCBI-DNA211471 -Node: Schmooz212801 -Node: Mathematical Packages217028 -Node: Bit-Twiddling217744 -Node: Modular Arithmetic225665 -Node: Prime Numbers228534 -Node: Random Numbers230215 -Node: Exact Random Numbers231435 -Node: Inexact Random Numbers234181 -Node: Fast Fourier Transform236532 -Node: Cyclic Checksum237446 -Node: Graphing244571 -Node: Character Plotting245251 -Node: PostScript Graphing251089 -Node: Column Ranges255097 -Node: Drawing the Graph258417 -Node: Graphics Context263014 -Node: Rectangles267208 -Node: Legending270354 -Node: Legacy Plotting274779 -Node: Example Graph276487 -Node: Solid Modeling284587 -Node: Color300794 -Node: Color Data-Type301620 -Ref: Color Data-Type-Footnote-1261941 -Node: Color Spaces305581 -Ref: Color Spaces-Footnote-1271875 -Node: Spectra315434 -Node: Color Difference Metrics323004 -Node: Color Conversions326666 -Node: Color Names329317 -Node: Daylight336339 -Node: Root Finding341138 -Node: Minimizing345119 -Ref: Minimizing-Footnote-1301934 -Node: Commutative Rings347157 -Node: Matrix Algebra358549 -Node: Database Packages359679 -Node: Relational Database360087 -Node: Using Databases361118 -Node: Table Operations369657 -Node: Single Row Operations371774 -Node: Match-Keys375050 -Node: Multi-Row Operations378335 -Node: Indexed Sequential Access Methods381431 -Node: Sequential Index Operations383339 -Node: Table Administration387317 -Node: Database Interpolation388727 -Node: Embedded Commands390241 -Node: Database Extension391882 -Node: Command Intrinsics393982 -Node: Define-tables Example395584 -Node: The *commands* Table397396 -Node: Command Service399709 -Node: Command Example401654 -Node: Database Macros406303 -Node: Within-database Example408933 -Node: Database Browser410852 -Node: Relational Infrastructure412730 -Node: Base Table413507 -Node: The Base418368 -Node: Base Tables422788 -Node: Base Field Types425445 -Node: Composite Keys426988 -Node: Base Record Operations430382 -Node: Match Keys433530 -Node: Aggregate Base Operations435329 -Node: Base ISAM Operations437366 -Node: Catalog Representation439784 -Node: Relational Database Objects445280 -Node: Database Operations449505 -Node: Weight-Balanced Trees455859 -Node: Construction of Weight-Balanced Trees459813 -Node: Basic Operations on Weight-Balanced Trees463261 -Node: Advanced Operations on Weight-Balanced Trees466187 -Node: Indexing Operations on Weight-Balanced Trees472207 -Node: Other Packages476032 -Node: Data Structures476583 -Node: Arrays477400 -Node: Subarrays482891 -Node: Array Mapping486245 -Node: Association Lists488990 -Node: Byte491241 -Node: Byte/Number Conversions499604 -Node: MAT-File Format511631 -Node: Portable Image Files512974 -Node: Collections514601 -Node: Dynamic Data Type520757 -Node: Hash Tables522016 -Node: Object524916 -Node: Priority Queues533150 -Node: Queues534217 -Node: Records535855 -Node: Sorting and Searching539345 -Node: Common List Functions540030 -Node: List construction540474 -Node: Lists as sets542169 -Node: Lists as sequences548782 -Node: Destructive list operations554036 -Node: Non-List functions556705 -Node: Tree Operations557775 -Node: Chapter Ordering559541 -Node: Sorting561170 -Node: Topological Sort567171 -Node: Hashing568864 -Node: Space-Filling Curves569865 -Node: Peano-Hilbert Space-Filling Curve570085 -Node: Sierpinski Curve571277 -Node: Soundex573731 -Node: String Search575345 -Node: Sequence Comparison578018 -Node: Procedures581424 -Node: Type Coercion581944 -Node: String-Case582361 -Node: String Ports584209 -Node: Line I/O584966 -Node: Multi-Processing587018 -Node: Metric Units588120 -Node: Standards Support596342 -Node: RnRS597171 -Node: With-File598378 -Node: Transcripts598639 -Node: Rev2 Procedures598958 -Node: Rev4 Optional Procedures600666 -Node: Multi-argument / and -601234 -Node: Multi-argument Apply601748 -Node: Rationalize602150 -Node: Promises603412 -Node: Dynamic-Wind604467 -Node: Eval605719 -Node: Values609054 -Node: SRFI609852 -Node: SRFI-1611285 -Node: SRFI-2617429 -Node: SRFI-8618223 -Node: SRFI-9619017 -Node: Session Support620436 -Node: Repl620913 -Node: Quick Print622194 -Node: Debug623483 -Node: Breakpoints624367 -Node: Trace626388 -Node: System Interface629792 -Node: Directories630353 -Node: Transactions631828 -Node: CVS637524 -Node: Extra-SLIB Packages638596 -Node: About SLIB640897 -Node: Installation641640 -Node: Porting646734 -Ref: Porting-Footnote-1555316 -Node: Coding Guidelines648663 -Node: Copyrights651753 -Node: About this manual655155 -Node: Index656435 +Node: Top1050 +Node: The Library System1830 +Node: Feature2245 +Ref: Feature-Footnote-14358 +Node: Require5422 +Node: Library Catalogs8232 +Node: Catalog Creation9818 +Node: Catalog Vicinities12409 +Node: Compiling Scheme15318 +Node: Module Conventions16086 +Ref: Module Conventions-Footnote-115790 +Node: Module Manifests17905 +Node: Module Semantics24174 +Node: Top-level Variable References25906 +Ref: Top-level Variable References-Footnote-125205 +Node: Module Analysis28540 +Node: Universal SLIB Procedures29984 +Node: Vicinity30703 +Node: Configuration35672 +Node: Input/Output39213 +Node: System43424 +Node: Miscellany47174 +Node: Scheme Syntax Extension Packages50488 +Node: Defmacro51328 +Node: R4RS Macros53936 +Node: Macro by Example55457 +Node: Macros That Work58668 +Node: Syntactic Closures65450 +Node: Syntax-Case Macros84160 +Node: Define-Structure88676 +Node: Fluid-Let92589 +Node: Yasos93779 +Node: Yasos terms94719 +Node: Yasos interface95891 +Node: Setters98343 +Node: Yasos examples101344 +Node: Textual Conversion Packages104430 +Node: Precedence Parsing105331 +Node: Precedence Parsing Overview106130 +Ref: Precedence Parsing Overview-Footnote-192368 +Node: Rule Types107883 +Node: Ruleset Definition and Use109969 +Node: Token definition112657 +Node: Nud and Led Definition115647 +Node: Grammar Rule Definition118282 +Node: Format126334 +Node: Format Interface127181 +Node: Format Specification130001 +Node: Standard Formatted I/O164087 +Node: Standard Formatted Output165095 +Node: Standard Formatted Input175192 +Node: Programs and Arguments182214 +Node: Getopt182830 +Node: Command Line189908 +Node: Parameter lists193453 +Node: Getopt Parameter lists197629 +Node: Filenames201062 +Node: Batch205387 +Node: HTML213937 +Node: HTML Tables221689 +Node: HTTP and CGI229219 +Node: Parsing HTML234169 +Node: URI236951 +Node: Printing Scheme242831 +Node: Generic-Write243268 +Node: Object-To-String244827 +Node: Pretty-Print245438 +Node: Time and Date248854 +Node: Time Zone250220 +Node: Posix Time255673 +Node: Common-Lisp Time258625 +Node: Time Infrastructure260591 +Node: NCBI-DNA261802 +Node: Schmooz263727 +Node: Mathematical Packages268256 +Node: Bit-Twiddling269021 +Node: Modular Arithmetic281008 +Node: Prime Numbers284612 +Node: Random Numbers286794 +Node: Exact Random Numbers287776 +Node: Inexact Random Numbers290537 +Node: Fast Fourier Transform292983 +Node: Cyclic Checksum294111 +Node: Graphing303476 +Node: Character Plotting303805 +Node: PostScript Graphing309646 +Node: Column Ranges311628 +Node: Drawing the Graph313486 +Node: Graphics Context314712 +Node: Rectangles317024 +Node: Legending318945 +Node: Legacy Plotting322142 +Node: Example Graph323249 +Node: Solid Modeling327759 +Node: Color351601 +Node: Color Data-Type352612 +Ref: Color Data-Type-Footnote-1284376 +Node: Color Spaces358369 +Ref: Color Spaces-Footnote-1294375 +Node: Spectra370274 +Node: Color Difference Metrics382078 +Node: Color Conversions385366 +Node: Color Names389006 +Node: Daylight396689 +Node: Root Finding401853 +Node: Minimizing406185 +Ref: Minimizing-Footnote-1325873 +Node: Commutative Rings408394 +Node: Matrix Algebra420462 +Node: Database Packages422035 +Node: Relational Database422438 +Node: Using Databases423442 +Node: Table Operations430658 +Node: Single Row Operations432012 +Node: Match-Keys434523 +Node: Multi-Row Operations436752 +Node: Indexed Sequential Access Methods439440 +Node: Sequential Index Operations440524 +Node: Table Administration443107 +Node: Database Interpolation444263 +Node: Embedded Commands445497 +Node: Database Extension447183 +Node: Command Intrinsics449704 +Node: Define-tables Example451428 +Node: The *commands* Table453178 +Node: Command Service455558 +Node: Command Example457663 +Node: Database Macros462328 +Node: Within-database463389 +Node: Within-database Example467960 +Node: Database Browser469922 +Node: Relational Infrastructure471391 +Node: Base Table471795 +Node: The Base474637 +Node: Base Tables478020 +Node: Base Field Types479690 +Node: Composite Keys480635 +Node: Base Record Operations482873 +Node: Match Keys484812 +Node: Aggregate Base Operations485815 +Node: Base ISAM Operations487046 +Node: Catalog Representation488515 +Node: Relational Database Objects491286 +Node: Database Operations494070 +Node: Weight-Balanced Trees498159 +Node: Construction of Weight-Balanced Trees502153 +Node: Basic Operations on Weight-Balanced Trees505925 +Node: Advanced Operations on Weight-Balanced Trees509145 +Node: Indexing Operations on Weight-Balanced Trees515503 +Node: Other Packages519732 +Node: Data Structures520387 +Node: Arrays521297 +Node: Subarrays537830 +Node: Array Mapping540359 +Node: Association Lists543098 +Node: Byte545792 +Node: Byte/Number Conversions552214 +Node: MAT-File Format559755 +Node: Portable Image Files561303 +Node: Collections563302 +Node: Dynamic Data Type570079 +Node: Hash Tables571690 +Node: Object574797 +Node: Priority Queues584148 +Node: Queues585299 +Node: Records587191 +Node: Sorting and Searching591002 +Node: Common List Functions591803 +Node: List construction592364 +Node: Lists as sets594388 +Node: Lists as sequences601898 +Node: Destructive list operations607714 +Node: Non-List functions610724 +Node: Tree Operations612077 +Node: Chapter Ordering614118 +Node: Sorting616063 +Node: Topological Sort622251 +Node: Hashing624164 +Node: Space-Filling Curves625476 +Node: Hilbert Space-Filling Curve625936 +Node: Peano Space-Filling Curve634464 +Node: Sierpinski Curve635724 +Node: Soundex638404 +Node: String Search640187 +Node: Sequence Comparison643272 +Node: Procedures647125 +Node: Type Coercion647783 +Node: String-Case648432 +Node: String Ports650820 +Node: Line I/O651780 +Node: Multi-Processing654063 +Node: Metric Units655440 +Node: Standards Support664254 +Node: RnRS665166 +Node: With-File666775 +Node: Transcripts667248 +Node: Rev2 Procedures667791 +Node: Rev4 Optional Procedures670214 +Node: Multi-argument / and -670979 +Node: Multi-argument Apply671573 +Node: Rationalize672062 +Node: Promises673492 +Node: Dynamic-Wind674227 +Node: Eval675646 +Node: Values679319 +Node: SRFI680355 +Node: SRFI-1682144 +Node: SRFI-2693631 +Node: SRFI-8694050 +Node: SRFI-9694469 +Node: Session Support695156 +Node: Repl696162 +Node: Quick Print697691 +Node: Debug699333 +Node: Breakpoints700639 +Node: Trace703394 +Node: System Interface707940 +Node: Directories708727 +Node: Transactions710523 +Node: CVS716514 +Node: Extra-SLIB Packages718222 +Node: About SLIB720688 +Node: Installation721619 +Node: The SLIB script730918 +Node: Porting731819 +Ref: Porting-Footnote-1590851 +Node: Coding Guidelines733598 +Node: Copyrights736248 +Node: About this manual739997 +Node: Index740742 End Tag Table |