Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl-copy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard M Kreuter
cmucl-copy
Commits
fbb02a78
Commit
fbb02a78
authored
22 years ago
by
toy
Browse files
Options
Downloads
Patches
Plain Diff
Document the user-defined hash table extension. (From Robert
P. Goldman.)
parent
e5489f53
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/cmu-user/extensions.tex
+40
-0
40 additions, 0 deletions
docs/cmu-user/extensions.tex
with
40 additions
and
0 deletions
docs/cmu-user/extensions.tex
+
40
−
0
View file @
fbb02a78
...
...
@@ -382,6 +382,46 @@ by \cmucl.
If no
\kwd
{
initial-value
}
is specified, arrays are initialized to zero.
\subsection
{
Hash tables
}
The
\tindexed
{
hash-tables
}
defined by
\clisp
{}
have limited utility because they
are limited to testing their keys using the equality predicates
provided by (pre-CLOS)
\clisp
{}
.
\cmucl
{}
overcomes this limitation
by allowing its users to specify new hash table tests and hashing
methods. The hashing method must also be specified, since the
compiler is unable to determine a good hashing function for an
arbitrary equality (equivalence) predicate.
\begin{defun}
{
extensions:
}{
define-hash-table-test
}
%
{
\args
{
\var
{
hash-table-test-name
}
\var
{
test-function
}
\var
{
hash-function
}}}
The
\var
{
hash-table-test-name
}
must be a symbol.
% I just assumed the above. [2002/10/10:rpg]
The
\var
{
test-function
}
takes two objects and returns true
iff they are the same. The
\var
{
hash-function
}
takes one object and
returns two values: the (positive fixnum) hash value and true if
the hashing depends on pointer values and will have to be redone
if the object moves.
To create a hash-table using this new ``test'' (really, a
test/hash-function pair), use
\code
{
(
\index
[funs]
{
make-hash-table
}
make-hash-table :test
\var
{
hash-table-test-name
}
\ldots
)
}
.
Note that it is the
\var
{
hash-table-test-name
}
that will be
returned by the function
\findexed
{
hash-table-test
}
, when applied to
a hash-table created using this function.
This function updates
\vindexed
{
hash-table-tests
}
, which is now
internal.
\end{defun}
% NOTE: This should be further updated with discussion of weak
% hash-tables. I've never used them, so haven't bothered to figure
% them out, and am not qualified to write even the most rudimentary
% docs. [2002/10/10:rpg]
\section
{
Default Interrupts for Lisp
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment