Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the hash-set Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 13:41:15 2020 GMT+0.
• Introduction | What hash-set is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
hash-set is an implementation of the hash-set data structure. It has constant time lookup, insertion and deletion.
All tests are known to run successfully on SBCL, CCL, ECL, ABCL and CLISP.
Basic usage:
(ql:quickload 'hash-set)
Note: *!hash-set!*
means the hash-set is destructively
modified. Functions that are destructive have an 'n' in front of their
name like CL's reverse
and nreverse
. So, the destructive
version of hs-insert
is hs-ninsert
.
() -> hash-set
Creates a new hash-set.
(let ((hash-set (make-hash-set)))
;; Operations on hash-set
)
list -> hash-set
Creates a hash-set containing all the elements of a list.
HASH-SET> (list-to-hs (alexandria:iota 10))
#<HASH-SET of count: 10 {1008832EF3}>
hash-set -> list
Creates a list containing all the elements of the hash-set.
HASH-SET> (hs-to-list (list-to-hs (alexandria:iota 10)))
(0 1 2 3 4 5 6 7 8 9)
hash-set -> integer
Return the number of elements in the hash-set.
HASH-SET> (hs-count (list-to-hs '(4 5 6 7)))
4
hash-set -> bool
Predicate that tests whether the hash-set is empty or not.
HASH-SET> (hs-emptyp (make-hash-set))
T
hash-set hash-set -> bool
Compares two hash-sets for equality.
HASH-SET> (hs-equal (list-to-hs '(7 8 9))
(list-to-hs '(7 8 9)))
T
hash-set -> hash-set
Returns a copy of the hash-set.
HASH-SET> (let ((hash-set (list-to-hs '(1 2 3 4))))
(hs-equal hash-set
(hs-copy hash-set)))
T
hash-set elt -> bool
Predicate that tests the existence of an element in the hash-set.
HASH-SET-TEST> (let ((hash-set (list-to-hs '(1 2 3 4))))
(hs-memberp hash-set 4))
T
HASH-SET-TEST> (let ((hash-set (list-to-hs '(1 2 3 4))))
(hs-memberp hash-set 8))
NIL
Do something with each element of the hash-set.
HASH-SET> (dohashset (elt (list-to-hs (alexandria:iota 10)))
(princ elt))
0123456789
NIL
function hash-set -> hash-set
Maps a function over a hash-set and returns a hash-set containing all the mapped values.
HASH-SET> (hs-to-list (hs-map (lambda (x) (* x x))
(list-to-hs (alexandria:iota 10))))
(0 1 4 9 16 25 36 49 64 81)
function hash-set -> hash-set
Filters out elements from a hash-set that test true with function
.
HASH-SET> (hs-to-list (hs-filter #'oddp
(list-to-hs (alexandria:iota 10))))
(1 3 5 7 9)
hash-set elt -> hash-set
Returns a new hash-set which contains the element elt
in
addition to all the elements of the hash-set given as the argument.
HASH-SET> (hs-to-list (hs-insert (list-to-hs '(4 5 6)) 123))
(4 5 6 123)
hash-set elt -> *!hash-set!*
Inserts elt into the hash-set and returns the modified hash-set.
HASH-SET> (let ((hash-set (list-to-hs '(1 2 3 4))))
(hs-ninsert hash-set 1984)
(hs-to-list hash-set))
(1 2 3 4 1984)
hash-set elt -> hash-set
Returns a copy of the hash-set, but with the elt
removed from
it.
HASH-SET> (hs-to-list (hs-remove (list-to-hs '(4 5 6 7)) 5))
(4 6 7)
hash-set elt -> *!hash-set!*
Removes the element elt
from the hash-set.
predicate hash-set -> hash-set
HASH-SET> (hs-to-list (hs-remove-if #'evenp
(list-to-hs (alexandria:iota 10))))
(1 3 5 7 9)
The elements testing true with the predicate are removed from a copy of the hash-set.
predicate hash-set -> *!hash-set!*
The elements testing true with the predicate are removed from the hash-set.
predicate hash-set -> hash-set
The elements testing false with the predicate are removed from a copy of the hash-set.
predicate hash-set -> *!hash-set!*
The elements testing false with the predicate are removed from the hash-set.
predicate hash-set -> bool
A function that returns true if any elements of the hash-set test true with the predicate.
HASH-SET> (hs-any #'oddp (list-to-hs '(2 4 6 8 9)))
T
predicate hash-set -> bool
A function that returns true if all elements of the hash-set test true with the predicate.
HASH-SET> (hs-all #'evenp (list-to-hs '(2 4 6 8 9)))
NIL
hash-set hash-set -> hash-set
Returns a hash-set that is the union of two hash-sets.
HASH-SET> (hs-to-list (hs-union (list-to-hs '(1 2 3))
(list-to-hs '(4 5 6))))
(1 2 3 4 5 6)
hash-set-a hash-set-b -> *!hash-set-a!*
Returns a modified hash-set-a
with all of hash-set-b
s
elements added to it.
hash-set hash-set -> hash-set
Returns a hash-set that is the intersection of two hash-sets.
hash-set-a hash-set-b -> *!hash-set-a!*
Returns a modified hash-set-a
which contains the elements of the
intersection of hash-set-a
and hash-set-b
.
hash-set-a hash-set-b -> hash-set
Returns a hash-set that is the set-difference of hash-set-a
and hash-set-b
.
HASH-SET> (hs-to-list (hs-intersection (list-to-hs '(1 2 3 4))
(list-to-hs '(3 4 5 6))))
(3 4)
hash-set-a hash-set-b -> *!hash-set-a!*
Returns a modified hash-set-a
that contains the elements of the
set-difference of hash-set-a
and hash-set-b
.
hash-set-a hash-set-b -> hash-set
Returns a hash-set with the common elements removed.
HASH-SET> (hs-to-list (hs-symmetric-difference (list-to-hs '(1 2 3 4))
(list-to-hs '(3 4 5 6))))
(1 2 5 6)
hash-set-a hash-set-b -> bool
Returns t
if hash-set-a
is a subset of hash-set-b
.
HASH-SET> (hs-subsetp (list-to-hs '(1 2)) (list-to-hs '(1 2 3)))
T
hash-set-a hash-set-b -> bool
Returns t
if hash-set-a
is a proper-subset of hash-set-b
.
hash-set-a hash-set-b -> bool
Returns t
if hash-set-a
is a superset of hash-set-b
.
hash-set-a hash-set-b -> bool
Returns t
if hash-set-a
is a proper-superset of hash-set-b
.
hash-set -> hash-set
Returns the powerset of the hash-set.
HASH-SET> (hs-to-list (hs-powerset (list-to-hs '(1 2 3))))
(NIL (1) (2) (1 2) (3) (1 3) (2 3) (1 2 3))
hash-set-a hash-set-b -> hash-set
Returns the hash-set containing the elements of the cartesian product
of hash-set-a
and hash-set-b
.
HASH-SET> (hs-to-list (hs-cartesian-product (list-to-hs (alexandria:iota 3 :start 1))
(list-to-hs (alexandria:iota 3 :start 10))))
((1 10) (1 11) (1 12) (2 10) (2 11) (2 12) (3 10) (3 11) (3 12))
For even more usage examples please see test.lisp
.
CL-USER> (ql:quickload 'hash-set-tests)
To load "hash-set-tests":
Load 1 ASDF system:
hash-set-tests
; Loading "hash-set-tests"
[package hash-set]................................
[package hash-set-test].
(HASH-SET-TESTS)
CL-USER> (in-package :hash-set-test)
#<PACKAGE "HASH-SET-TEST">
HASH-SET-TEST> (run!)
Running test suite ALL-TESTS
...
Engineering guidance taken from Robert Smith's map-set and Takaya Ochiai's cl-intset libraries.
The people at #lisp for their help and guidance.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The hash-set system |
Samuel Chase <samebchase@gmail.com>
Unlicense
An implementation of the hash-set data structure.
hash-set.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The hash-set.asd file | ||
• The hash-set/package.lisp file | ||
• The hash-set/hash-set.lisp file |
Next: The hash-set/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
hash-set.asd
hash-set (system)
Next: The hash-set/hash-set․lisp file, Previous: The hash-set․asd file, Up: Lisp files [Contents][Index]
Previous: The hash-set/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
hash-set (system)
hash-set.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The hash-set package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions | ||
• Exported classes |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
hash-set.lisp (file)
Next: Exported classes, Previous: Exported macros, Up: Exported definitions [Contents][Index]
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
hash-set.lisp (file)
Previous: Exported functions, Up: Exported definitions [Contents][Index]
A hashset.
hash-set.lisp (file)
standard-object (class)
(make-hash-table :test (function equal) :synchronized t)
table (generic function)
(setf table) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions | ||
• Internal generic functions |
Next: Internal generic functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
hash-set.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
hash-set.lisp (file)
automatically generated writer method
hash-set.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F H L |
---|
Jump to: | F H L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
D F G H L M T |
---|
Jump to: | %
(
D F G H L M T |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | S T |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
S | |||
Slot, table : | Exported classes | ||
| |||
T | |||
table : | Exported classes | ||
|
Jump to: | S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C H P S |
---|
Jump to: | C H P S |
---|