The persistent-tables Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The persistent-tables Reference Manual

This is the persistent-tables Reference Manual, version 0.0.1, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:09:58 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Persistent Hash Tables

This is a dead simple implementation of persistent hash tables on top of a port of David Va Horn's persistent random-access lists, SRFI-101.

These are like hash tables in most respects, with similar, but not identical performance profiles, with the major exception that modification is functional, ptbl-set returns a new hash table with the new association in it. The previous table is left unmodified.

Example Usage:

(setq tbl ({} the-empty-ptbl :x 10))
(ptbl-get tbl :x) -> 10
(ptbl-get the-empty-ptbl :x) -> nil

The function {} allows you to quickly create a new ptbl or to update the associations in a ptbl, when the first argument is itself a ptbl. Eg:

({} :x 10 :y 11)

Creates a new ptbl with :x and :y associations.

({} a-table :x 10 :y 11)

Returns a new ptbl with the same associations as a-table except where :x and :y are concerned.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 persistent-tables

Maintainer

Vincent Toups

Author

Vincent Toups

Description

Persistent tables.

Version

0.0.1

Dependencies
Source

persistent-tables.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 persistent-tables.asd

Location

persistent-tables.asd

Systems

persistent-tables (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 persistent-tables/package.lisp

Parent

persistent-tables (system)

Location

package.lisp

Packages

persistent-tables


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 persistent-tables/persistent-tables.lisp

Dependency

package.lisp (file)

Parent

persistent-tables (system)

Location

persistent-tables.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 persistent-tables

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: fresh-ptbl &optional N TEST

Create a fresh persistent hash table with N (107) bins and TEST for equality.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl->alist TBL

Return an association list with the same assocations as TBL.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl->ppstring TBL

Produce a nice string representation of the persistent hash table TBL.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-get TBL KEY &optional OR-VALUE

Retreive the association for KEY from the persistent hashtable TBL. Return OR-VALUE if no association exists, which defaults to NIL.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-keys TBL

Return a list of all keys in the persistent hash table TBL. Order is unspecified.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-set TBL KEY VAL

Return a new persistent hash table which is like TBL except that KEY is associated with VAL.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-values TBL

Return a list of all values in the persistent hash table TBL. Order is unspecified.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: {} MAYBE-PTBL &rest ARGS

Construct or augment a PTBL with the KEY/VAL pairs in ARGS. If MAYBE-PTBL is not a PTBL, treat it as the first key and use an empty persistent table.

Package

persistent-tables

Source

persistent-tables.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: the-empty-ptbl

An empty EQUAL testing persistent hash table.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Special Variable: the-empty-ptbl-eq

An empty EQ testing persistent hash table.

Package

persistent-tables

Source

persistent-tables.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: named-let NAME BINDINGS &body BODY
Package

persistent-tables

Source

persistent-tables.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: bucket-keys BUCKET

Return all the keys in a BUCKET.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: bucket-values BUCKET

Return all the values in a BUCKET.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: copy-ptbl INSTANCE
Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: empty? X
Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: make-ptbl &key (BUCKETS BUCKETS) (TEST TEST)
Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-add-to-bucket BUCKET KEY VAL TEST &optional ACC

Add an association to BUCKET with KEY, VAL and KEY equality tested under TEST.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-buckets INSTANCE
Function: (setf ptbl-buckets) VALUE INSTANCE
Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-dip-buckets P F

Set the BUCKETS part of a persistent table P to (FUNCALL F B), where B is the old buckets.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-get-from-bucket BUCKET KEY TEST

Find an association to BUCKET with KEY. TEST defines key equality.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-n-buckets P

Return the number of buckets in the table P.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-p OBJECT
Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-set-buckets P B

Set the BUCKETS part of a persistent table P to B.

Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl-test INSTANCE
Function: (setf ptbl-test) VALUE INSTANCE
Package

persistent-tables

Source

persistent-tables.lisp (file)

Function: ptbl? OBJECT
Package

persistent-tables

Source

persistent-tables.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Structures

Structure: ptbl ()
Package

persistent-tables

Source

persistent-tables.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: buckets
Readers

ptbl-buckets (function)

Writers

(setf ptbl-buckets) (function)

Slot: test
Readers

ptbl-test (function)

Writers

(setf ptbl-test) (function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   P  
Index Entry  Section

F
File, Lisp, persistent-tables.asd: The persistent-tables<dot>asd file
File, Lisp, persistent-tables/package.lisp: The persistent-tables/package<dot>lisp file
File, Lisp, persistent-tables/persistent-tables.lisp: The persistent-tables/persistent-tables<dot>lisp file

L
Lisp File, persistent-tables.asd: The persistent-tables<dot>asd file
Lisp File, persistent-tables/package.lisp: The persistent-tables/package<dot>lisp file
Lisp File, persistent-tables/persistent-tables.lisp: The persistent-tables/persistent-tables<dot>lisp file

P
persistent-tables.asd: The persistent-tables<dot>asd file
persistent-tables/package.lisp: The persistent-tables/package<dot>lisp file
persistent-tables/persistent-tables.lisp: The persistent-tables/persistent-tables<dot>lisp file

Jump to:   F   L   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (   {  
B   C   E   F   M   N   P  
Index Entry  Section

(
(setf ptbl-buckets): Internal functions
(setf ptbl-test): Internal functions

{
{}: Exported functions

B
bucket-keys: Internal functions
bucket-values: Internal functions

C
copy-ptbl: Internal functions

E
empty?: Internal functions

F
fresh-ptbl: Exported functions
Function, (setf ptbl-buckets): Internal functions
Function, (setf ptbl-test): Internal functions
Function, bucket-keys: Internal functions
Function, bucket-values: Internal functions
Function, copy-ptbl: Internal functions
Function, empty?: Internal functions
Function, fresh-ptbl: Exported functions
Function, make-ptbl: Internal functions
Function, ptbl->alist: Exported functions
Function, ptbl->ppstring: Exported functions
Function, ptbl-add-to-bucket: Internal functions
Function, ptbl-buckets: Internal functions
Function, ptbl-dip-buckets: Internal functions
Function, ptbl-get: Exported functions
Function, ptbl-get-from-bucket: Internal functions
Function, ptbl-keys: Exported functions
Function, ptbl-n-buckets: Internal functions
Function, ptbl-p: Internal functions
Function, ptbl-set: Exported functions
Function, ptbl-set-buckets: Internal functions
Function, ptbl-test: Internal functions
Function, ptbl-values: Exported functions
Function, ptbl?: Internal functions
Function, {}: Exported functions

M
Macro, named-let: Internal macros
make-ptbl: Internal functions

N
named-let: Internal macros

P
ptbl->alist: Exported functions
ptbl->ppstring: Exported functions
ptbl-add-to-bucket: Internal functions
ptbl-buckets: Internal functions
ptbl-dip-buckets: Internal functions
ptbl-get: Exported functions
ptbl-get-from-bucket: Internal functions
ptbl-keys: Exported functions
ptbl-n-buckets: Internal functions
ptbl-p: Internal functions
ptbl-set: Exported functions
ptbl-set-buckets: Internal functions
ptbl-test: Internal functions
ptbl-values: Exported functions
ptbl?: Internal functions

Jump to:   (   {  
B   C   E   F   M   N   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   B   S   T  
Index Entry  Section

B
buckets: Internal structures

S
Slot, buckets: Internal structures
Slot, test: Internal structures
Special Variable, the-empty-ptbl: Internal special variables
Special Variable, the-empty-ptbl-eq: Internal special variables

T
test: Internal structures
the-empty-ptbl: Internal special variables
the-empty-ptbl-eq: Internal special variables

Jump to:   B   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, persistent-tables: The persistent-tables package
persistent-tables: The persistent-tables system
persistent-tables: The persistent-tables package
ptbl: Internal structures

S
Structure, ptbl: Internal structures
System, persistent-tables: The persistent-tables system

Jump to:   P   S