Common Lisp Package: STDUTILS.GDS

README:

FUNCTION

Private

DROP-VKNODE-VALUE (TNODE STACK)

Clear value in target node (tnode) and if alist is size zero or nil, delete entry in parent table (snode) and, if zero, also delete

ENSURE-VKTABLE (NODE)

Ensure that the provided node has a proper table for the next recusion of vector-keyed-put

EXTEND-VKTABLE (TABLE KEY)

Add a vk node to the table for key

UPGRADE-VKNODE (NODE)

Upgrade vktable entry from assoc to hashed when the size exceeds the vk threshold. Do this to the table in the provided vknode. Also downgrade (is this a good idea as it may cause thrashing?)

VECTOR-KEYED-GET (VKTABLE VKEY)

Internal recursion to walk tree and return value for vector key: vkey

VECTOR-KEYED-PUT (VKTABLE VKEY VALUE)

Internal recursion to walk tree and add or modify a value for vector key: vkey

VECTOR-KEYED-REM (VKTABLE VKEY)

Remove a vector keyed value from the vktable and clean up any empty nodes or tables created thereby. Also decrement the count

VKTABLE-GET-EXTEND (VKTABLE NODE KEY &AUX (TABLE (ENSURE-VKTABLE NODE)))

Get node from table. If new node, update vktable item count add a new node to the table for key. If table has exceeded size, upgrade it to a hashed table and return the new node

Undocumented

DROP-VKTABLE-ENTRY (KEY NODE STACK)

END-OF-VKEY (VKEY INDEX)

EXTRACT-ASSOC-TYPE (ACELL TYPE)

HASH-TABLE->ALIST (HASH)

MAKE-VKNODE (&OPTIONAL VALUE TABLE)

VKNODE-TABLE (NODE)

VKNODE-VALUE (NODE)

VKTI-NEXT-VALUE (ITER)

MACRO

Public

SETF (&REST ARGS &ENVIRONMENT ENV)

Takes pairs of arguments like SETQ. The first is a place and the second is the value that is supposed to go into that place. Returns the last value. The place argument may be any of the access forms for which SETF knows a corresponding setting form.

Undocumented

DEFPROTOCOL (NAME OPLIST &OPTIONAL ARGS)

DO-ITERATOR ((VAR STRUCT) &BODY BODY)

DO-TABLE ((KEY VALUE TABLE) &BODY BODY)

Private

Undocumented

MVPASS2 (FORM)

GENERIC-FUNCTION

Public

ADD (STRUCT KEY VALUE)

This function adds a keyed value to a collection

CLEAR (STRUCT)

Reset the structure to its original state

CONTAINS (STRUCT KEY)

A predicate determining if a collection contains a keyed value

CONVERT (TYPE STRUCT)

Converts one structure to another if a conversion routine exists

COPY (STRUCT)

Returns a copy in new storage of the provided structure

DROP (STRUCT KEY)

This function drops a keyed value from a collection

DROP-LAST (ITERATOR)

This drops the last visited element in a walk over a collection

FIND-ELT (STRUCT VALUE &KEY ALL KEY TEST (KEY #'IDENTITY) (TEST #'EQ))

Finds one or more values matching value using key as an accessor and test as the comparison function between value

GET-ITERATOR (STRUCT &KEY TYPE (TYPE PAIR))

Return a function which when called returns two values; the next element in the collection and whether the iterator is completed (t on completion). The value is nil when termination is reached. The type argument is gds specific and indicates what aspects of the main ds should be returned during iteration

GET-VALUE (STRUCT KEY)

The standard access for a datastructure. Two valued return; first is actual associated value, second is whether it existed

SETFGET-VALUE (VALUE STRUCT KEY)

Updating or adding a keyed value to a collection

INSERT (STRUCT ELEMENT LOCATION)

MAP-ELEMENTS (FUNCTION STRUCT)

Map all the elments of the provided structure and apply function to them. For tables this means all the key-value pairs as a cons pair.

MAP-KEYS (FUNCTION STRUCT)

Maps over just the keys for keyed structures

MAP-VALUES (FUNCTION STRUCT)

Maps over just the values for keyed structures

NEXT (ITER)

An function for getting the next element from a structure or iterator. It takes an optional reference to an element (ie next/prev)

NEXT-P (ITER)

Predicate form of next

SIZE-OF (STRUCT)

The number of times you'd have to call add to reproduce this structure

STORAGE-ALLOCATED (STRUCT)

The number of add operations reserved in memory for this ds

Undocumented

EMPTY (TABLE)

FIND-VALUE (TABLE VALUE &KEY ALL (KEY #'IDENTITY) (TEST #'EQ))

INITIALIZE-INSTANCE (INSTANCE &REST INITARGS &KEY ARGUMENT-PRECEDENCE-ORDER (LAMBDA-LIST NIL LAMBDA-LIST-P) (CLOSE-DIR-P NIL) PATH FILE NAME DIRECTORY TERMS READER SUB-READERS OFFSET POSITION POSITIONS (CONVENTION CALLING-CONVENTION) (CALLING-CONVENTION CCONV CALLING-CONVENTION-P) (CCONV CDECL CCONV-P) SEARCH-PATH NAME INITIAL-CONTENTS CONTAINER-TYPE (ROOT *RBT-EMPTY-NODE*) CONTAINER LINES CHAINED-HANDLER URI PROPERTIES SIZE INITIAL-SIZE (TEST 'EQ) (DIMENSIONS 2) (MAX-SIZE 1000) QUERY SEARCHER (CREATE-P NIL) (CREATE-IF-MISSING-P NIL) READERS STARTS TERM INFO TERM-POSITIONS SEGMENT LITERAL-CHAR-CODE-LIMIT &ALLOW-OTHER-KEYS)

RESET (ITER)

TABLE-ELEMENTS (TABLE)

TABLE-KEYS (TABLE)

TABLE-VALUES (TABLE)

SLOT-ACCESSOR

Private

ITER-TYPE (OBJECT)

Type can be :key, :value or :pair

SETFITER-TYPE (NEW-VALUE OBJECT)

Type can be :key, :value or :pair

Undocumented

ALIST (OBJECT)

SETFALIST (NEW-VALUE OBJECT)

CURRENT-PTR (OBJECT)

SETFCURRENT-PTR (NEW-VALUE OBJECT)

HASHED-TABLE-REF (OBJECT)

SETFHASHED-TABLE-REF (NEW-VALUE OBJECT)

KEY-TEST (OBJECT)

SETFKEY-TEST (NEW-VALUE OBJECT)

LAST-KEY (OBJECT)

SETFLAST-KEY (NEW-VALUE OBJECT)

LAST-PTR (OBJECT)

SETFLAST-PTR (NEW-VALUE OBJECT)

LIST-PTR (OBJECT)

SETFLIST-PTR (NEW-VALUE OBJECT)

PROTOCOL-OPERATIONS (OBJECT)

SETFPROTOCOL-OPERATIONS (NEW-VALUE OBJECT)

REFERENCE (OBJECT)

SETFREFERENCE (NEW-VALUE OBJECT)

TABLE-COUNT (OBJECT)

SETFTABLE-COUNT (NEW-VALUE OBJECT)

TABLE-ROOT (OBJECT)

SETFTABLE-ROOT (NEW-VALUE OBJECT)

VHASH-THRESHOLD (OBJECT)

VKTI-STACK (OBJECT)

SETFVKTI-STACK (NEW-VALUE OBJECT)

VARIABLE

Private

*VECTOR-KEYED-THRESHOLD*

When to switch internally from assoc list to hash table

Undocumented

*COUNT-UPDATED*

*VECHASH-THRESHOLD*

CLASS

Public

Undocumented

ASSOC-TABLE

ASSOC-TABLE-ITERATOR

HASHED-TABLE

HASHED-TABLE-ITERATOR

ITERATOR

STANDARD-PROTOCOL

TABLE

VECTOR-KEYED-TABLE

Private

Undocumented

VECTOR-KEYED-TABLE-ITERATOR