This is a collection of small functions I found handy to have.
The newest version of the library is 0.1. It can be obtained from http://practical-scheme.net/vault/hashutils-0.1.tar.gz.
If you read this document off-line, check out the newest document online. http://practical-scheme.net/vault/hashutils.html.
Once you get the package, you can install it by the following procedure.
To use the functions, load and import hashutils module:
(require "hashutils") (import hashutils)
Or, if you're using modutils,
A hash table is created by
(apply make-hash-table INITARGS).
VALUE pairs are inserted to the
hash table. It is an error to give a
KEY without accompanying
(define *command-table* (hash-table () 'help (list help "show help") 'quit (list (lambda () (exit 0)) "quit program") 'ls (list cmd-list "list elements"))) (define *abbrev-table* (hash-table `(,equal?) "RCS" "Revision Control System" "CVS" "Concurrent Versions System"))
For each key-value pair of the hash table, a procedure
called with three arguments: a key, a value, and a partial result
returned by the previous call of
PROC. For the first key-value
INIT is passed as the third argument. Returns
the result of the last call of
For example, the following call returns a list of keys whose value equals "N/A".
(hash-table-fold *table* (lambda (k v r) (if (equal? value "N/A") (cons k r) r)) '())
VALUEto the current value of
KEYin a hash table
HASH. If no value is associated to the key,
(list VALUE)is put as the value.
Jump to: h
This document was generated on 17 October 2000 using texi2html 1.56k.