The history-tree Reference Manual

This is the history-tree Reference Manual, version 0.1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Mar 15 06:13:48 2023 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 history-tree

Store the history of a browser’s visited paths.

Author

Atlas Engineer LLC

Home Page

https://github.com/atlas-engineer/history-tree

License

BSD 3-Clause

Version

0.1.1

Dependencies
  • alexandria (system).
  • cl-custom-hash-table (system).
  • local-time (system).
  • nclasses (system).
  • trivial-package-local-nicknames (system).
Source

history-tree.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 history-tree/history-tree.asd

Source

history-tree.asd.

Parent Component

history-tree (system).

ASDF Systems

history-tree.


3.1.2 history-tree/package.lisp

Source

history-tree.asd.

Parent Component

history-tree (system).

Packages

history-tree.


3.1.3 history-tree/history-tree.lisp

Source

history-tree.asd.

Parent Component

history-tree (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 history-tree

Source

package.lisp.

Nickname

htree

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Macros

Macro: do-tree ((var tree) &body body)

Apply actions in BODY to all the nodes in a tree.
Nodes are bound to VAR.
If TREE is a node, it’s passed right away,
if it is a tree, then the root is taken.

Always return nil, as it is an explicitly imperative macro.

Package

history-tree.

Source

history-tree.lisp.


5.1.2 Ordinary functions

Function: add-entry (history data &optional last-access)

Add DATA to an ‘entry’ in HISTORY ‘entries’.
If DATA is already there, don’t alter the entry.
Return the new or existing ‘entry’.

The higher-level functions take care of adding entries for you, so you normally need not call this function. See ‘add-child’ instead.
One case in which this function might be useful is when you want to import flat history data, e.g. a list of visited URLs that’s not bound to any owner.

Package

history-tree.

Source

history-tree.lisp.

Function: add-owner (history owner-id &key creator-id data)

Create and register owner object for OWNER-IDENTIFIER.
CREATOR-ID is the optional identifier of the parent owner.
DATA is the optional, arbitrary payload associated to the owner. Return the newly created owner. If the owner with such identifier already exists, return it and raise a warning.

Package

history-tree.

Source

history-tree.lisp.

Function: current-binding (owner &optional node)
Package

history-tree.

Source

history-tree.lisp.

Function: data-last-access (history data)

Return data last access across all its nodes, regardless of the owner. Return Epoch if DATA is not found or if entry has no timestamp.

Package

history-tree.

Source

history-tree.lisp.

Function: delete-data (history data)

Delete entry matching DATA from HISTORY.
If nodes are still associated to entry, do nothing.

Package

history-tree.

Source

history-tree.lisp.

Function: delete-owner (history owner-id)

Delete ‘owner’ corresponding to OWNER-ID from HISTORY.
For every branch ‘owner’ has nodes on, remove all its nodes if the branch is without any owner.
Return owner, or nil if there is no owner corresponding to OWNER-ID.

Package

history-tree.

Source

history-tree.lisp.

Function: find-nodes (history data)

Return the nodes matching DATA.

Package

history-tree.

Source

history-tree.lisp.

Function: make (&rest args &key key test hash-function initial-owners)

Return a new ‘history-tree’.

Package

history-tree.

Source

history-tree.lisp.

Function: map-owned-tree (function tree owner &key flatten include-root collect-function)

Like ‘map-tree’ but restrict traversal to OWNER’s nodes. TREE is unused.

Package

history-tree.

Source

history-tree.lisp.

Function: map-tree (function tree &key owner flatten include-root collect-function children-function)

Map the FUNCTION over the TREE.
If TREE is a ‘htree:history-tree’, start from its OWNER root. If TREE is a ‘htree:node’, start from it.
OWNER can be an ID or an ‘owner’ object.
Include results of applying FUNCTION over ROOT if INCLUDE-ROOT is non-nil.
Return results as cons cells tree if FLATTEN is nil and as a flat list otherwise.
COLLECT-FUNCTION is the function of two arguments that glues the current node result to the result of further traversal.

Package

history-tree.

Source

history-tree.lisp.

Function: owned-children (owner)

Return the OWNER’s owned children for the current node.

Package

history-tree.

Source

history-tree.lisp.

Function: owned-p (owner node)
Package

history-tree.

Source

history-tree.lisp.

Function: owned-parent (owner node)

Return OWNER’s parent if it’s owned, nil otherwise.

Package

history-tree.

Source

history-tree.lisp.

Function: owned-root (owner)

Return the first parent among the contiguous owned parents of NODE.

Package

history-tree.

Source

history-tree.lisp.

Function: owner (history owner-spec)

Return the ‘owner’ object identified by OWNER-SPEC in HISTORY. OWNER may be an owner ID or owner object.

Package

history-tree.

Source

history-tree.lisp.

Function: owner-node (history owner-spec)
Package

history-tree.

Source

history-tree.lisp.

Function: reset-owner (history owner-id)

Disown all OWNER’s nodes and create a new root node with the previous current node entry.

Package

history-tree.

Source

history-tree.lisp.


5.1.3 Generic functions

Generic Function: add-child (data history owner-spec)
Package

history-tree.

Methods
Method: add-child (data (history history-tree) owner-spec)

Create or find a node holding DATA and set current node to it.
Return the (possibly new) current node.
Return NIL if OWNER-SPEC does not refer to an existing owner.

If current node matches DATA (which may be non-identical since the ‘history-tree”s ‘key’ and ‘test’ functions may identify two non-identical pieces of data as equal), do nothing.

If DATA is found among the children, OWNER-SPEC current node ‘forward-child’ is set to the matching child, the owner current node is set to this child.

If there is no current node, this creates the ‘origin’ node of OWNER-SPEC and also sets ‘current’ to it. If the owner has a ‘creator-id’ set,
the new node is added to the children of the current node of the creator.

Source

history-tree.lisp.

Generic Function: add-children (children-data history owner-spec)
Package

history-tree.

Methods
Method: add-children (children-data (history history-tree) owner-spec)

Add CHILDREN-DATA to the HISTORY OWNER-SPEC current node.
Each child is added with ‘add-child’ to the current node.

If the owner does not have any node yet, then first element of CHILDREN-DATA forms the new root, while the rest of the elements form the ‘children’ of this root.

Return the (maybe new) current node, which holds the last piece of data in ‘children-data’.

Source

history-tree.lisp.

Generic Function: all-branch-nodes (history owner-spec)
Package

history-tree.

Methods
Method: all-branch-nodes ((history history-tree) owner-spec)

Return a list of all nodes that belong to the branch OWNER-SPEC node is on. These nodes do not necessarily belong to OWNER-SPEC.
See ‘all-contiguous-owned-nodes’.

Source

history-tree.lisp.

Generic Function: all-children (node &key owner &allow-other-keys)
Package

history-tree.

Methods
Method: all-children ((history history-tree) &key owner)

Return a list of all the children of HISTORY’s OWNER-SPEC current node. Children may not all be owned by OWNER-SPEC.

Source

history-tree.lisp.

Method: all-children ((node node) &key &allow-other-keys)

Return a list of all the children of NODE, recursively.

Source

history-tree.lisp.

Generic Function: all-contiguous-owned-children (history owner-spec &optional node)
Package

history-tree.

Methods
Method: all-contiguous-owned-children ((history history-tree) owner-spec &optional node)

Return a list of all the children of HISTORY’s OWNER-SPEC current node, recursively.

Source

history-tree.lisp.

Generic Function: all-contiguous-owned-nodes (history owner-spec)
Package

history-tree.

Methods
Method: all-contiguous-owned-nodes ((history history-tree) owner-spec)

Return a list of all nodes contiguous to OWNER-SPEC node, starting from the top-most parent, in depth-first order.

Source

history-tree.lisp.

Generic Function: all-contiguous-owned-parents (history owner-spec)
Package

history-tree.

Methods
Method: all-contiguous-owned-parents ((history history-tree) owner-spec)

Return a list of parents of owned by HISTORY OWNER-SPEC current node, recursively. First parent comes first in the resulting list.

Source

history-tree.lisp.

Generic Function: all-data (history)
Package

history-tree.

Methods
Method: all-data ((history history-tree))

Return a list of all entries data, in unspecified order.

Source

history-tree.lisp.

Generic Function: all-forward-children (history owner-spec &optional node)
Package

history-tree.

Methods
Method: all-forward-children ((history history-tree) owner-spec &optional node)

Return a list of the forward children of NODE, recursively. First child comes first in the resulting list.

Source

history-tree.lisp.

Generic Function: all-owner-nodes (history owner-spec)
Package

history-tree.

Methods
Method: all-owner-nodes ((history history-tree) owner-spec)

Return a list of all OWNER nodes, in unspecified order.

Source

history-tree.lisp.

Generic Function: all-parents (node &key owner &allow-other-keys)
Package

history-tree.

Methods
Method: all-parents ((history history-tree) &key owner &allow-other-keys)

Return a list of all parents of the current node. Parents may not be owned by the current owner. First parent comes first in the resulting list.

Source

history-tree.lisp.

Method: all-parents ((node node) &key &allow-other-keys)

Return a list of parents of NODE, recursively. First parent comes first in the resulting list.

Source

history-tree.lisp.

Generic Function: backward (history owner-spec &optional count)
Package

history-tree.

Methods
Method: backward ((history history-tree) owner-spec &optional count)

Go COUNT parent up from the OWNER-SPEC current node, if possible. Return (VALUES HISTORY OWNER).

Source

history-tree.lisp.

Generic Function: backward-owned-parents (history owner-spec &optional count)
Package

history-tree.

Methods
Method: backward-owned-parents ((history history-tree) owner-spec &optional count)

Go COUNT parent up from the OWNER-SPEC current node, if possible. Only contiguous owned parents are considered.
Return (VALUES HISTORY OWNER).

Source

history-tree.lisp.

Generic Reader: bindings (object)
Generic Writer: (setf bindings) (object)
Package

history-tree.

Methods
Reader Method: bindings ((node node))
Writer Method: (setf bindings) ((node node))

The key is an ‘owner’, the value is a
‘binding’. This slot also allows us to know to which owner a node belongs.

Source

history-tree.lisp.

Target Slot

bindings.

Generic Reader: children (object)
Generic Writer: (setf children) (object)
Package

history-tree.

Methods
Reader Method: children ((node node))
Writer Method: (setf children) ((node node))

Order does not matter.

Source

history-tree.lisp.

Target Slot

children.

Generic Reader: creator-id (object)
Generic Writer: (setf creator-id) (object)
Package

history-tree.

Methods
Reader Method: creator-id ((owner owner))
Writer Method: (setf creator-id) ((owner owner))

The owner-id in ‘origin’s parent node that
created this owner. May be nil, in which case ‘origin’ is a root node.

Unless the parent was disowned by this ‘creator-id’,

(gethash (owner history CREATOR-ID) (bindings (parent (origin OWNER))))

should return non-nil.

We store the owner-id instead of the ‘owner’ object so that we keep the information of who created this owner even after the creator object has been deleted.

Source

history-tree.lisp.

Target Slot

creator-id.

Generic Reader: current (object)
Package

history-tree.

Methods
Reader Method: current ((owner owner))

The current node.
It’s updated every time a node is visited.

Source

history-tree.lisp.

Target Slot

current.

Generic Function: (setf current) (owner)
Package

history-tree.

Methods
Method: (setf current) ((owner owner))

This setter protects against setting OWNER’s ‘current’ slot to an invalid object.

Source

history-tree.lisp.

Generic Function: data (object)
Package

history-tree.

Methods
Reader Method: data ((owner owner))

Arbitrary data.
Use it to persist extra owner information to history.

Source

history-tree.lisp.

Target Slot

data.

Method: data ((node node))
Source

history-tree.lisp.

Reader Method: data ((entry entry))

Arbitrary data.

Source

history-tree.lisp.

Target Slot

data.

Generic Writer: (setf data) (object)
Package

history-tree.

Methods
Writer Method: (setf data) ((owner owner))

Arbitrary data.
Use it to persist extra owner information to history.

Source

history-tree.lisp.

Target Slot

data.

Writer Method: (setf data) ((entry entry))

Arbitrary data.

Source

history-tree.lisp.

Target Slot

data.

Generic Reader: entries (object)
Generic Writer: (setf entries) (object)
Package

history-tree.

Methods
Reader Method: entries ((history-tree history-tree))
Writer Method: (setf entries) ((history-tree history-tree))

Both the key and the value are an ‘entry’, so that
we can access the actual object from a given piece of data.
Indeed, with custom hash table the key that is store (here the entry) is not necessarily identical to the one used in ‘gethash’. So storing the entry as a value gives us access to to the actual object.

Source

history-tree.lisp.

Target Slot

entries.

Generic Reader: entry (object)
Generic Writer: (setf entry) (object)
Package

history-tree.

Methods
Reader Method: entry ((node node))
Writer Method: (setf entry) ((node node))

Required.
(Null entry is accepted only to ease deserialization.)
Arbitrary data (wrapped in an ‘entry’ object) carried
by the node. ‘history-tree”s ‘entries’ holds ‘entry’-‘node’ associations.

Source

history-tree.lisp.

Target Slot

entry.

Generic Function: forward (history owner-spec &optional count)
Package

history-tree.

Methods
Method: forward ((history history-tree) owner-spec &optional count)

Go COUNT forward-children down from OWNER-SPEC current node, if possible. Return (values HISTORY CURRENT-NODE)) so that ‘backward’ and ‘forward’ calls can be chained.

Source

history-tree.lisp.

Generic Function: go-to-child (data history owner-spec &key child-finder)
Package

history-tree.

Methods
Method: go-to-child (data (history history-tree) owner-spec &key child-finder)

Go to direct current node’s child matching DATA. Return (values HISTORY OWNER).

Source

history-tree.lisp.

Generic Function: go-to-owned-child (data history owner-spec)
Package

history-tree.

Methods
Method: go-to-owned-child (data (history history-tree) owner-spec)

Go to current node’s direct owned child matching DATA. A child is owned if it has a binding with OWNER. Return (values OWNER (current OWNER)).

Source

history-tree.lisp.

Generic Reader: hash-function (object)
Generic Writer: (setf hash-function) (object)
Package

history-tree.

Methods
Reader Method: hash-function ((history-tree history-tree))
Writer Method: (setf hash-function) ((history-tree history-tree))

Function that returns the hash of the result
of ‘key’ called over an ‘entry’.
Also see ‘test’.
It is a ‘function-symbol’ so that the history can be more easily serialized than if if were a function.

Source

history-tree.lisp.

Target Slot

hash-function.

Generic Reader: key (object)
Generic Writer: (setf key) (object)
Package

history-tree.

Methods
Reader Method: key ((history-tree history-tree))
Writer Method: (setf key) ((history-tree history-tree))

The result of this function is passed to ‘test’
and ‘hash-function’. It is useful to uniquely identify (i.e. avoid duplications) objects from one of their slots.
It is a ‘function-symbol’ so that the history can be more easily serialized than if if were a function.

Source

history-tree.lisp.

Target Slot

key.

Generic Function: last-access (entry)
Package

history-tree.

Methods
Method: last-access ((owner owner))

Return owner current node last access.

Source

history-tree.lisp.

Method: last-access ((node node))

Return node’s last access across all its owners. If the node has no owner, return Epoch.

Source

history-tree.lisp.

Method: last-access ((binding binding))

Ensure we return last-access as a timestamp, in case it was a string.

Source

history-tree.lisp.

Method: last-access ((entry entry))

Ensure we return last-access as a timestamp, in case it was a string.

Source

history-tree.lisp.

Generic Writer: (setf last-access) (object)
Package

history-tree.

Methods
Writer Method: (setf last-access) ((binding binding))

Timestamp of the last access to this node by the owner.

Source

history-tree.lisp.

Target Slot

last-access.

Writer Method: (setf last-access) ((entry entry))

The last access to the corresponding entry by
any owner. It’s useful to keep this access stored here so that when an entry goes owner-less, we can still consult the last time it was accessed.

Source

history-tree.lisp.

Target Slot

last-access.

Generic Reader: nodes (object)
Generic Writer: (setf nodes) (object)
Package

history-tree.

Methods
Reader Method: nodes ((owner owner))
Writer Method: (setf nodes) ((owner owner))

The list of all owned nodes.

Source

history-tree.lisp.

Target Slot

nodes.

Reader Method: nodes ((entry entry))
Writer Method: (setf nodes) ((entry entry))

The list of nodes that access an entry.

Source

history-tree.lisp.

Target Slot

nodes.

Generic Reader: origin (object)
Generic Writer: (setf origin) (object)
Package

history-tree.

Methods
Reader Method: origin ((owner owner))
Writer Method: (setf origin) ((owner owner))

The first node created for this owner.
Not to be confused with the root, since the owner be go back to a parent of ‘origin’.

Source

history-tree.lisp.

Target Slot

origin.

Generic Reader: owners (object)
Generic Writer: (setf owners) (object)
Package

history-tree.

Methods
Reader Method: owners ((history-tree history-tree))
Writer Method: (setf owners) ((history-tree history-tree))

The key is an owner identifier (an artitrary value), the value is an ‘owner’.

Source

history-tree.lisp.

Target Slot

owners.

Generic Reader: parent (object)
Generic Writer: (setf parent) (object)
Package

history-tree.

Methods
Reader Method: parent ((node node))
Writer Method: (setf parent) ((node node))

If nil, it means the node is a root node. (The first of the parents.)

Source

history-tree.lisp.

Target Slot

parent.

Generic Reader: test (object)
Generic Writer: (setf test) (object)
Package

history-tree.

Methods
Reader Method: test ((history-tree history-tree))
Writer Method: (setf test) ((history-tree history-tree))

Function that tests if the two results of ‘key’ called
over two entries are equal.
Also see ‘hash-function’.
It is a ‘function-symbol’ so that the history can be more easily serialized than if if were a function.

Source

history-tree.lisp.

Target Slot

test.

Generic Function: visit-all (history owner-spec node)
Package

history-tree.

Methods
Method: visit-all ((history history-tree) owner-spec node)

Like ‘visit’ but on all nodes between the current node and NODE.
This is only possible if the current node and NODE are on the same branch. If they are not, an error is raised.
Return (values HISTORY OWNER).

Source

history-tree.lisp.


5.1.4 Classes

Class: entry

Wrapped data as stored in ‘history-tree”s ‘entries’.
Each entry has a unique datum. Each ‘node’ points to one entry. Multiple nodes may point to the same entry. Entries may also be node-less; they are kept around so that we can remember the data that was visited since the beginning of time. Node-less entries are available for manual deletion with ‘delete-data’.

Package

history-tree.

Source

history-tree.lisp.

Direct methods
Direct slots
Slot: history

Required.
This is gives access to the custom hash functions, see the corresponding ‘history-tree’ slots.
We allow null values for easier deserialization.

Type

(or null history-tree:history-tree)

Initargs

:history

Readers

history.

Writers

(setf history).

Slot: data

Arbitrary data.

Initargs

:data

Readers

data.

Writers

(setf data).

Slot: last-access

The last access to the corresponding entry by
any owner. It’s useful to keep this access stored here so that when an entry goes owner-less, we can still consult the last time it was accessed.

Type

(or local-time:timestamp string)

Initform

(local-time:now)

Initargs

:last-access

Writers

(setf last-access).

Slot: nodes

The list of nodes that access an entry.

Type

list

Initform

(quote nil)

Initargs

:nodes

Readers

nodes.

Writers

(setf nodes).

Class: history-tree

Starting point of the global history tree data structure.

Package

history-tree.

Source

history-tree.lisp.

Direct methods
Direct slots
Slot: owners

The key is an owner identifier (an artitrary value), the value is an ‘owner’.

Type

hash-table

Initform

(make-hash-table :test (function equalp))

Initargs

:owners

Readers

owners.

Writers

(setf owners).

Slot: entries

Both the key and the value are an ‘entry’, so that
we can access the actual object from a given piece of data.
Indeed, with custom hash table the key that is store (here the entry) is not necessarily identical to the one used in ‘gethash’. So storing the entry as a value gives us access to to the actual object.

Type

hash-table

Initform

(history-tree::make-entry-hash-table)

Initargs

:entries

Readers

entries.

Writers

(setf entries).

Slot: key

The result of this function is passed to ‘test’
and ‘hash-function’. It is useful to uniquely identify (i.e. avoid duplications) objects from one of their slots.
It is a ‘function-symbol’ so that the history can be more easily serialized than if if were a function.

Type

history-tree::function-symbol

Initform

(quote identity)

Initargs

:key

Readers

key.

Writers

(setf key).

Slot: test

Function that tests if the two results of ‘key’ called
over two entries are equal.
Also see ‘hash-function’.
It is a ‘function-symbol’ so that the history can be more easily serialized than if if were a function.

Type

history-tree::function-symbol

Initform

(quote equalp)

Initargs

:test

Readers

test.

Writers

(setf test).

Slot: hash-function

Function that returns the hash of the result
of ‘key’ called over an ‘entry’.
Also see ‘test’.
It is a ‘function-symbol’ so that the history can be more easily serialized than if if were a function.

Type

history-tree::function-symbol

Initform

(quote sxhash)

Initargs

:hash-function

Readers

hash-function.

Writers

(setf hash-function).

Class: node

Node structure of the history tree.
Each node has one parent (unless it’s a root node) and zero or multiple children. Nodes may have zero or multiple owners.

Package

history-tree.

Source

history-tree.lisp.

Direct methods
Direct slots
Slot: parent

If nil, it means the node is a root node. (The first of the parents.)

Type

(or null history-tree:node)

Initargs

:parent

Readers

parent.

Writers

(setf parent).

Slot: children

Order does not matter.

Type

list

Initform

(quote nil)

Initargs

:children

Readers

children.

Writers

(setf children).

Slot: bindings

The key is an ‘owner’, the value is a
‘binding’. This slot also allows us to know to which owner a node belongs.

Initform

(make-hash-table)

Initargs

:bindings

Readers

bindings.

Writers

(setf bindings).

Slot: entry

Required.
(Null entry is accepted only to ease deserialization.)
Arbitrary data (wrapped in an ‘entry’ object) carried
by the node. ‘history-tree”s ‘entries’ holds ‘entry’-‘node’ associations.

Type

(or null history-tree:entry)

Initargs

:entry

Readers

entry.

Writers

(setf entry).

Class: owner

The high-level information about an owner.
Each owner is identified by a unique identifier, which is arbitrary data (may even be NIL).

Package

history-tree.

Source

history-tree.lisp.

Direct methods
Direct slots
Slot: origin

The first node created for this owner.
Not to be confused with the root, since the owner be go back to a parent of ‘origin’.

Type

(or null history-tree:node)

Initargs

:origin

Readers

origin.

Writers

(setf origin).

Slot: data

Arbitrary data.
Use it to persist extra owner information to history.

Initargs

:data

Readers

data.

Writers

(setf data).

Slot: creator-id

The owner-id in ‘origin’s parent node that
created this owner. May be nil, in which case ‘origin’ is a root node.

Unless the parent was disowned by this ‘creator-id’,

(gethash (owner history CREATOR-ID) (bindings (parent (origin OWNER))))

should return non-nil.

We store the owner-id instead of the ‘owner’ object so that we keep the information of who created this owner even after the creator object has been deleted.

Initargs

:creator-id

Readers

creator-id.

Writers

(setf creator-id).

Slot: creator-node

The current node of the creator when this owner
is created. This is useful since the owner corresponding to ‘creator-id’ may be deleted before the ‘origin’ node is added.

Type

(or null history-tree:node)

Initargs

:creator-node

Readers

creator-node.

Writers

(setf creator-node).

Slot: current

The current node.
It’s updated every time a node is visited.

Type

(or null history-tree:node)

Initargs

:current

Readers

current.

Writers

This slot is read-only.

Slot: nodes

The list of all owned nodes.

Type

(or null (cons history-tree:node))

Initform

(quote nil)

Initargs

:nodes

Readers

nodes.

Writers

(setf nodes).


5.2 Internals


5.2.1 Macros

Macro: export-always (symbols &optional package)

Like ‘export’, but also evaluated at compile time.

Package

history-tree.

Source

history-tree.lisp.


5.2.2 Ordinary functions

Function: binding-p (object)
Package

history-tree.

Source

history-tree.lisp.

Function: branch-owners (node)

Return the list of all NODE’s children (including NODE) owners.

Package

history-tree.

Source

history-tree.lisp.

Function: data-equal-entry-p (data entry)
Package

history-tree.

Source

history-tree.lisp.

Function: delete-disowned-branch-nodes (history nodes)
Package

history-tree.

Source

history-tree.lisp.

Function: delete-node (history node)
Package

history-tree.

Source

history-tree.lisp.

Function: depth (history owner-spec)

Return the number of (possibly unowned) parents of OWNER-SPEC cutrent node.

Package

history-tree.

Source

history-tree.lisp.

Function: disown (owner node)

Remove binding between OWNER and NODE.
Return true if NODE was owned by OWNER, nil otherwise.

Package

history-tree.

Source

history-tree.lisp.

Function: disown-all (history owner)
Package

history-tree.

Source

history-tree.lisp.

Function: disowned-branch-nodes (node)

Return true if all NODE’s children (including NODE) are disowned. Return nil otherwise.
As a second value, return the list of all NODE’s children, including NODE.

Package

history-tree.

Source

history-tree.lisp.

Function: disowned-p (node)
Package

history-tree.

Source

history-tree.lisp.

Function: ensure-timestamp (string-or-timestamp)
Package

history-tree.

Source

history-tree.lisp.

Function: entry-equal-p (a b)
Package

history-tree.

Source

history-tree.lisp.

Function: entry-hash (a)
Package

history-tree.

Source

history-tree.lisp.

Function: entry-p (object)
Package

history-tree.

Source

history-tree.lisp.

Function: find-child (data owner)

Return the direct child node of OWNER which matches DATA.

Package

history-tree.

Source

history-tree.lisp.

Function: find-entry (history data)

Return the nodes matching DATA.

Package

history-tree.

Source

history-tree.lisp.

Function: find-node (data nodes)

Return the node owned by OWNER which matches DATA.

Package

history-tree.

Source

history-tree.lisp.

Function: find-owned-child (data owner)

Return the direct child node owned by OWNER which matches DATA.

Package

history-tree.

Source

history-tree.lisp.

Function: first-hash-table-key (hash-table)
Package

history-tree.

Source

history-tree.lisp.

Function: first-hash-table-value (hash-table)
Package

history-tree.

Source

history-tree.lisp.

Function: history-tree-p (object)
Package

history-tree.

Source

history-tree.lisp.

Function: make-entry (history data &optional last-access)

Return an ‘entry’ wrapping DATA and suitable for HISTORY.

Package

history-tree.

Source

history-tree.lisp.

Function: make-entry-hash-table (&rest options)
Package

history-tree.

Source

history-tree.lisp.

Function: make-node (&key parent entry)
Package

history-tree.

Source

history-tree.lisp.

Function: make-origin-node (history owner-spec data)
Package

history-tree.

Source

history-tree.lisp.

Function: map-data (arg)
Package

history-tree.

Source

history-tree.lisp.

Function: node-contiguous-owned-parents (owner node)

Return a list of parents of owned by NODE, recursively. First parent comes first in the resulting list.

Package

history-tree.

Source

history-tree.lisp.

Function: node-p (object)
Package

history-tree.

Source

history-tree.lisp.

Function: owned-children-lister (owner)

Return a function which lists the OWNER’s owned children of the node argument.

Package

history-tree.

Source

history-tree.lisp.

Function: owner-p (object)
Package

history-tree.

Source

history-tree.lisp.


5.2.3 Generic functions

Generic Function: contiguous-size (history owner)
Package

history-tree.

Methods
Method: contiguous-size ((history history-tree) (owner owner))

Return the total number of owned nodes contiguous to the current OWNER node.

Source

history-tree.lisp.

Generic Reader: creator-node (object)
Generic Writer: (setf creator-node) (object)
Package

history-tree.

Methods
Reader Method: creator-node ((owner owner))
Writer Method: (setf creator-node) ((owner owner))

The current node of the creator when this owner
is created. This is useful since the owner corresponding to ‘creator-id’ may be deleted before the ‘origin’ node is added.

Source

history-tree.lisp.

Target Slot

creator-node.

Generic Reader: forward-child (object)
Generic Writer: (setf forward-child) (object)
Package

history-tree.

Methods
Reader Method: forward-child ((binding binding))
Writer Method: (setf forward-child) ((binding binding))

Which of the ‘children’ (in the bound ‘node’) is the child to go forward to for the bound owner.

Source

history-tree.lisp.

Target Slot

forward-child.

Generic Reader: history (object)
Generic Writer: (setf history) (object)
Package

history-tree.

Methods
Reader Method: history ((entry entry))
Writer Method: (setf history) ((entry entry))

Required.
This is gives access to the custom hash functions, see the corresponding ‘history-tree’ slots.
We allow null values for easier deserialization.

Source

history-tree.lisp.

Target Slot

history.

Generic Function: root (node)
Package

history-tree.

Methods
Method: root ((node node))
Source

history-tree.lisp.

Generic Function: size (owner &key owner &allow-other-keys)
Package

history-tree.

Methods
Method: size ((history history-tree) &key owner &allow-other-keys)

Return the total number of nodes for the branch OWNER’s current node sits on.

Source

history-tree.lisp.

Method: size ((owner owner) &key &allow-other-keys)

Return the total number of nodes owned by OWNER.

Source

history-tree.lisp.

Generic Function: visit (history owner-spec node)
Package

history-tree.

Methods
Method: visit ((history history-tree) owner-spec node)

Visit NODE with HISTORY’s OWNER-SPEC. Return (values HISTORY OWNER).

Source

history-tree.lisp.


5.2.4 Classes

Class: binding

The relationship between an owner and one of its nodes.
In particular, it encodes the forward child and the date of last access to the node for a given owner.

Package

history-tree.

Source

history-tree.lisp.

Direct methods
Direct slots
Slot: forward-child

Which of the ‘children’ (in the bound ‘node’) is the child to go forward to for the bound owner.

Type

(or null history-tree:node)

Initargs

:forward-child

Readers

forward-child.

Writers

(setf forward-child).

Slot: last-access

Timestamp of the last access to this node by the owner.

Type

(or local-time:timestamp string)

Initform

(local-time:now)

Initargs

:last-access

Writers

(setf last-access).


5.2.5 Types

Type: function-symbol ()
Package

history-tree.

Source

history-tree.lisp.

Type: non-negative-integer ()
Package

history-tree.

Source

history-tree.lisp.

Type: positive-integer ()
Package

history-tree.

Source

history-tree.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   B   C   D   E   F   G   H   K   L   M   N   O   P   R   S   T   V  
Index Entry  Section

(
(setf bindings): Public generic functions
(setf bindings): Public generic functions
(setf children): Public generic functions
(setf children): Public generic functions
(setf creator-id): Public generic functions
(setf creator-id): Public generic functions
(setf creator-node): Private generic functions
(setf creator-node): Private generic functions
(setf current): Public generic functions
(setf current): Public generic functions
(setf data): Public generic functions
(setf data): Public generic functions
(setf data): Public generic functions
(setf entries): Public generic functions
(setf entries): Public generic functions
(setf entry): Public generic functions
(setf entry): Public generic functions
(setf forward-child): Private generic functions
(setf forward-child): Private generic functions
(setf hash-function): Public generic functions
(setf hash-function): Public generic functions
(setf history): Private generic functions
(setf history): Private generic functions
(setf key): Public generic functions
(setf key): Public generic functions
(setf last-access): Public generic functions
(setf last-access): Public generic functions
(setf last-access): Public generic functions
(setf nodes): Public generic functions
(setf nodes): Public generic functions
(setf nodes): Public generic functions
(setf origin): Public generic functions
(setf origin): Public generic functions
(setf owners): Public generic functions
(setf owners): Public generic functions
(setf parent): Public generic functions
(setf parent): Public generic functions
(setf test): Public generic functions
(setf test): Public generic functions

A
add-child: Public generic functions
add-child: Public generic functions
add-children: Public generic functions
add-children: Public generic functions
add-entry: Public ordinary functions
add-owner: Public ordinary functions
all-branch-nodes: Public generic functions
all-branch-nodes: Public generic functions
all-children: Public generic functions
all-children: Public generic functions
all-children: Public generic functions
all-contiguous-owned-children: Public generic functions
all-contiguous-owned-children: Public generic functions
all-contiguous-owned-nodes: Public generic functions
all-contiguous-owned-nodes: Public generic functions
all-contiguous-owned-parents: Public generic functions
all-contiguous-owned-parents: Public generic functions
all-data: Public generic functions
all-data: Public generic functions
all-forward-children: Public generic functions
all-forward-children: Public generic functions
all-owner-nodes: Public generic functions
all-owner-nodes: Public generic functions
all-parents: Public generic functions
all-parents: Public generic functions
all-parents: Public generic functions

B
backward: Public generic functions
backward: Public generic functions
backward-owned-parents: Public generic functions
backward-owned-parents: Public generic functions
binding-p: Private ordinary functions
bindings: Public generic functions
bindings: Public generic functions
branch-owners: Private ordinary functions

C
children: Public generic functions
children: Public generic functions
contiguous-size: Private generic functions
contiguous-size: Private generic functions
creator-id: Public generic functions
creator-id: Public generic functions
creator-node: Private generic functions
creator-node: Private generic functions
current: Public generic functions
current: Public generic functions
current-binding: Public ordinary functions

D
data: Public generic functions
data: Public generic functions
data: Public generic functions
data: Public generic functions
data-equal-entry-p: Private ordinary functions
data-last-access: Public ordinary functions
delete-data: Public ordinary functions
delete-disowned-branch-nodes: Private ordinary functions
delete-node: Private ordinary functions
delete-owner: Public ordinary functions
depth: Private ordinary functions
disown: Private ordinary functions
disown-all: Private ordinary functions
disowned-branch-nodes: Private ordinary functions
disowned-p: Private ordinary functions
do-tree: Public macros

E
ensure-timestamp: Private ordinary functions
entries: Public generic functions
entries: Public generic functions
entry: Public generic functions
entry: Public generic functions
entry-equal-p: Private ordinary functions
entry-hash: Private ordinary functions
entry-p: Private ordinary functions
export-always: Private macros

F
find-child: Private ordinary functions
find-entry: Private ordinary functions
find-node: Private ordinary functions
find-nodes: Public ordinary functions
find-owned-child: Private ordinary functions
first-hash-table-key: Private ordinary functions
first-hash-table-value: Private ordinary functions
forward: Public generic functions
forward: Public generic functions
forward-child: Private generic functions
forward-child: Private generic functions
Function, add-entry: Public ordinary functions
Function, add-owner: Public ordinary functions
Function, binding-p: Private ordinary functions
Function, branch-owners: Private ordinary functions
Function, current-binding: Public ordinary functions
Function, data-equal-entry-p: Private ordinary functions
Function, data-last-access: Public ordinary functions
Function, delete-data: Public ordinary functions
Function, delete-disowned-branch-nodes: Private ordinary functions
Function, delete-node: Private ordinary functions
Function, delete-owner: Public ordinary functions
Function, depth: Private ordinary functions
Function, disown: Private ordinary functions
Function, disown-all: Private ordinary functions
Function, disowned-branch-nodes: Private ordinary functions
Function, disowned-p: Private ordinary functions
Function, ensure-timestamp: Private ordinary functions
Function, entry-equal-p: Private ordinary functions
Function, entry-hash: Private ordinary functions
Function, entry-p: Private ordinary functions
Function, find-child: Private ordinary functions
Function, find-entry: Private ordinary functions
Function, find-node: Private ordinary functions
Function, find-nodes: Public ordinary functions
Function, find-owned-child: Private ordinary functions
Function, first-hash-table-key: Private ordinary functions
Function, first-hash-table-value: Private ordinary functions
Function, history-tree-p: Private ordinary functions
Function, make: Public ordinary functions
Function, make-entry: Private ordinary functions
Function, make-entry-hash-table: Private ordinary functions
Function, make-node: Private ordinary functions
Function, make-origin-node: Private ordinary functions
Function, map-data: Private ordinary functions
Function, map-owned-tree: Public ordinary functions
Function, map-tree: Public ordinary functions
Function, node-contiguous-owned-parents: Private ordinary functions
Function, node-p: Private ordinary functions
Function, owned-children: Public ordinary functions
Function, owned-children-lister: Private ordinary functions
Function, owned-p: Public ordinary functions
Function, owned-parent: Public ordinary functions
Function, owned-root: Public ordinary functions
Function, owner: Public ordinary functions
Function, owner-node: Public ordinary functions
Function, owner-p: Private ordinary functions
Function, reset-owner: Public ordinary functions

G
Generic Function, (setf bindings): Public generic functions
Generic Function, (setf children): Public generic functions
Generic Function, (setf creator-id): Public generic functions
Generic Function, (setf creator-node): Private generic functions
Generic Function, (setf current): Public generic functions
Generic Function, (setf data): Public generic functions
Generic Function, (setf entries): Public generic functions
Generic Function, (setf entry): Public generic functions
Generic Function, (setf forward-child): Private generic functions
Generic Function, (setf hash-function): Public generic functions
Generic Function, (setf history): Private generic functions
Generic Function, (setf key): Public generic functions
Generic Function, (setf last-access): Public generic functions
Generic Function, (setf nodes): Public generic functions
Generic Function, (setf origin): Public generic functions
Generic Function, (setf owners): Public generic functions
Generic Function, (setf parent): Public generic functions
Generic Function, (setf test): Public generic functions
Generic Function, add-child: Public generic functions
Generic Function, add-children: Public generic functions
Generic Function, all-branch-nodes: Public generic functions
Generic Function, all-children: Public generic functions
Generic Function, all-contiguous-owned-children: Public generic functions
Generic Function, all-contiguous-owned-nodes: Public generic functions
Generic Function, all-contiguous-owned-parents: Public generic functions
Generic Function, all-data: Public generic functions
Generic Function, all-forward-children: Public generic functions
Generic Function, all-owner-nodes: Public generic functions
Generic Function, all-parents: Public generic functions
Generic Function, backward: Public generic functions
Generic Function, backward-owned-parents: Public generic functions
Generic Function, bindings: Public generic functions
Generic Function, children: Public generic functions
Generic Function, contiguous-size: Private generic functions
Generic Function, creator-id: Public generic functions
Generic Function, creator-node: Private generic functions
Generic Function, current: Public generic functions
Generic Function, data: Public generic functions
Generic Function, entries: Public generic functions
Generic Function, entry: Public generic functions
Generic Function, forward: Public generic functions
Generic Function, forward-child: Private generic functions
Generic Function, go-to-child: Public generic functions
Generic Function, go-to-owned-child: Public generic functions
Generic Function, hash-function: Public generic functions
Generic Function, history: Private generic functions
Generic Function, key: Public generic functions
Generic Function, last-access: Public generic functions
Generic Function, nodes: Public generic functions
Generic Function, origin: Public generic functions
Generic Function, owners: Public generic functions
Generic Function, parent: Public generic functions
Generic Function, root: Private generic functions
Generic Function, size: Private generic functions
Generic Function, test: Public generic functions
Generic Function, visit: Private generic functions
Generic Function, visit-all: Public generic functions
go-to-child: Public generic functions
go-to-child: Public generic functions
go-to-owned-child: Public generic functions
go-to-owned-child: Public generic functions

H
hash-function: Public generic functions
hash-function: Public generic functions
history: Private generic functions
history: Private generic functions
history-tree-p: Private ordinary functions

K
key: Public generic functions
key: Public generic functions

L
last-access: Public generic functions
last-access: Public generic functions
last-access: Public generic functions
last-access: Public generic functions
last-access: Public generic functions

M
Macro, do-tree: Public macros
Macro, export-always: Private macros
make: Public ordinary functions
make-entry: Private ordinary functions
make-entry-hash-table: Private ordinary functions
make-node: Private ordinary functions
make-origin-node: Private ordinary functions
map-data: Private ordinary functions
map-owned-tree: Public ordinary functions
map-tree: Public ordinary functions
Method, (setf bindings): Public generic functions
Method, (setf children): Public generic functions
Method, (setf creator-id): Public generic functions
Method, (setf creator-node): Private generic functions
Method, (setf current): Public generic functions
Method, (setf data): Public generic functions
Method, (setf data): Public generic functions
Method, (setf entries): Public generic functions
Method, (setf entry): Public generic functions
Method, (setf forward-child): Private generic functions
Method, (setf hash-function): Public generic functions
Method, (setf history): Private generic functions
Method, (setf key): Public generic functions
Method, (setf last-access): Public generic functions
Method, (setf last-access): Public generic functions
Method, (setf nodes): Public generic functions
Method, (setf nodes): Public generic functions
Method, (setf origin): Public generic functions
Method, (setf owners): Public generic functions
Method, (setf parent): Public generic functions
Method, (setf test): Public generic functions
Method, add-child: Public generic functions
Method, add-children: Public generic functions
Method, all-branch-nodes: Public generic functions
Method, all-children: Public generic functions
Method, all-children: Public generic functions
Method, all-contiguous-owned-children: Public generic functions
Method, all-contiguous-owned-nodes: Public generic functions
Method, all-contiguous-owned-parents: Public generic functions
Method, all-data: Public generic functions
Method, all-forward-children: Public generic functions
Method, all-owner-nodes: Public generic functions
Method, all-parents: Public generic functions
Method, all-parents: Public generic functions
Method, backward: Public generic functions
Method, backward-owned-parents: Public generic functions
Method, bindings: Public generic functions
Method, children: Public generic functions
Method, contiguous-size: Private generic functions
Method, creator-id: Public generic functions
Method, creator-node: Private generic functions
Method, current: Public generic functions
Method, data: Public generic functions
Method, data: Public generic functions
Method, data: Public generic functions
Method, entries: Public generic functions
Method, entry: Public generic functions
Method, forward: Public generic functions
Method, forward-child: Private generic functions
Method, go-to-child: Public generic functions
Method, go-to-owned-child: Public generic functions
Method, hash-function: Public generic functions
Method, history: Private generic functions
Method, key: Public generic functions
Method, last-access: Public generic functions
Method, last-access: Public generic functions
Method, last-access: Public generic functions
Method, last-access: Public generic functions
Method, nodes: Public generic functions
Method, nodes: Public generic functions
Method, origin: Public generic functions
Method, owners: Public generic functions
Method, parent: Public generic functions
Method, root: Private generic functions
Method, size: Private generic functions
Method, size: Private generic functions
Method, test: Public generic functions
Method, visit: Private generic functions
Method, visit-all: Public generic functions

N
node-contiguous-owned-parents: Private ordinary functions
node-p: Private ordinary functions
nodes: Public generic functions
nodes: Public generic functions
nodes: Public generic functions

O
origin: Public generic functions
origin: Public generic functions
owned-children: Public ordinary functions
owned-children-lister: Private ordinary functions
owned-p: Public ordinary functions
owned-parent: Public ordinary functions
owned-root: Public ordinary functions
owner: Public ordinary functions
owner-node: Public ordinary functions
owner-p: Private ordinary functions
owners: Public generic functions
owners: Public generic functions

P
parent: Public generic functions
parent: Public generic functions

R
reset-owner: Public ordinary functions
root: Private generic functions
root: Private generic functions

S
size: Private generic functions
size: Private generic functions
size: Private generic functions

T
test: Public generic functions
test: Public generic functions

V
visit: Private generic functions
visit: Private generic functions
visit-all: Public generic functions
visit-all: Public generic functions