The dlist Reference Manual

Table of Contents

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

The dlist Reference Manual

This is the dlist Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:42:12 2018 GMT+0.


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

1 Introduction

dlist - A Common Lisp library that implements doubly-linked lists

dlist is a Common Lisp library that implements the doubly-linked list data structure. dlist provides many operations on doubly-linked lists, or dlists, which are documented in the file documentation.html , which is available with the source. If your lisp implementation supports user-extensible sequences (which only SBCL and ABCL do currently), you will be able to use the standard Common Lisp sequence functions (map, reduce, etc.) with dlists. dlist does not have any dependencies other than a common lisp implementation.

Obtaining and installing dlist

dlist is available from http://github.com/krzysz00/dlist and can be installed via Quicklisp (not yet). To use dlist, simply load the ASDF system. Use:

(asdf:oos 'asdf:test-op :dlist)

to run the test suite.

dlist is licensed under the 3-Clause BSD Licence, see the file COPYING for details.

Contact Information

You can reach the author (Krzysztof Drewniak) at krzysdrewniak@gmail.com. If you find any bugs, please report them at dlist's GitHub issue tracker.


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 dlist

Author

Krzyszxtof Drewniak <krzysdrewniak@gmail.com>

License

3-Clause BSD

Description

An implementation of the doubly-linked list in Common Lisp.

Source

dlist.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 dlist.asd

Location

dlist.asd

Systems

dlist (system)

Packages

dlist-system


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

3.1.2 dlist/package.lisp

Parent

dlist (system)

Location

package.lisp

Packages

dlist


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

3.1.3 dlist/dcons.lisp

Dependency

package.lisp (file)

Parent

dlist (system)

Location

dcons.lisp

Exported Definitions
Internal Definitions

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

3.1.4 dlist/dlist.lisp

Dependency

dcons.lisp (file)

Parent

dlist (system)

Location

dlist.lisp

Exported Definitions
Internal Definitions

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

3.1.5 dlist/modification.lisp

Dependency

dlist.lisp (file)

Parent

dlist (system)

Location

modification.lisp

Exported Definitions

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

3.1.6 dlist/mapping.lisp

Dependency

modification.lisp (file)

Parent

dlist (system)

Location

mapping.lisp

Exported Definitions

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

3.1.7 dlist/more-ops.lisp

Dependency

mapping.lisp (file)

Parent

dlist (system)

Location

more-ops.lisp

Exported Definitions

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

3.1.8 dlist/generic-sequences.lisp

Dependency

more-ops.lisp (file)

Parent

dlist (system)

Location

generic-sequences.lisp


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

4 Packages

Packages are listed by definition order.


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

4.1 dlist-system

Source

dlist.asd

Use List

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

4.2 dlist

Source

package.lisp (file)

Use List

common-lisp

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


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

5.1.1 Macros

Macro: dlist-pop DLIST &key FROM-END

Pops an element from dlist and returns it. If ‘from-end’ is non-‘nil’, the element will be popped from the end of the dlist. Otherwise, it will be popped from the begining.

Package

dlist

Source

modification.lisp (file)

Macro: dlist-push OBJ DLIST &key AT-END

Pushes ‘obj’ onto ‘dlist’. If ‘at-end’ is not-nil, the element is added to the end of dlist, otherwise it is added to the begining.

Package

dlist

Source

modification.lisp (file)

Macro: dodcons (VAR DLIST &optional RESULT-FORM FROM-END) &body BODY

Loops over the dconses in ‘dlist’, binding ‘var’ to each in turn. If ‘from-end’ is non-nil, the loop proceeds from the last element of ther list to the first. This is basically ‘dolist’ for dlists.

Package

dlist

Source

mapping.lisp (file)

Macro: dodlist (VAR DLIST &optional RESULT-FORM FROM-END) &body BODY

Loops over the elements in ‘dlist’, binding each to ‘var’ in turn, then executing ‘body’. If ‘from-end’ is non-nil, the loop proceeds from the end of the list to the begining.

Package

dlist

Source

mapping.lisp (file)


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

5.1.2 Functions

Function: copy-dlist DLIST &key DEEP-COPY

Copies ‘dlist’, returning a new dlist with the same elements as ‘dlist’. If ‘deep-copy’ is true, ‘copy-dlist’ deep-copies dlists and sequences.

Package

dlist

Source

more-ops.lisp (file)

Function: data DCONS

Accesses the ‘data’ slot of a dcons. The ‘data’ of nil is nil.

Package

dlist

Source

dcons.lisp (file)

Writer

(setf data) (function)

Function: (setf data) VAL PLACE

Sets the ‘data’ slot of ‘place’ (which must be a ‘dcons’) to ‘val’

Package

dlist

Source

dcons.lisp (file)

Reader

data (function)

Function: dcons PREV DATA NEXT

Constructs a ‘dcons’ with the given ‘prev’, ‘data’, and ‘next’

Package

dlist

Source

dcons.lisp (file)

Function: dconsp OBJECT

Returns T if ‘object’ is a dcons

Package

dlist

Source

dcons.lisp (file)

Function: dlist &rest ELEMENTS

Returns a doubly-linked list (dlist) with the elements in ‘elements’

Package

dlist

Source

dlist.lisp (file)

Function: dlist->list DLIST

Converts a dlist to a list

Package

dlist

Source

dlist.lisp (file)

Function: dlist-append &rest DLISTS

Appends ‘dlists’ non-derstructively by calling ‘dlist-nconc’ with shallow copies of each dlist.

Package

dlist

Source

more-ops.lisp (file)

Function: dlist-first DLIST

Gets the first ‘dcons’ in a ‘dlist’

Package

dlist

Source

dlist.lisp (file)

Writer

(setf dlist-first) (function)

Function: (setf dlist-first) VAL PLACE
Package

dlist

Source

dlist.lisp (file)

Reader

dlist-first (function)

Function: dlist-last DLIST

Gets the last ‘dcons’ in a ‘dlist’

Package

dlist

Source

dlist.lisp (file)

Writer

(setf dlist-last) (function)

Function: (setf dlist-last) VAL PLACE
Package

dlist

Source

dlist.lisp (file)

Reader

dlist-last (function)

Function: dlist-length DLIST

Returns the length of ‘dlist’

Package

dlist

Source

more-ops.lisp (file)

Function: dlist-nconc &rest DLISTS

Appends ‘dlists’. This works like ‘nconc’ for singly-linked lists, except it is destructive and the resuld will share structure with the input dlists. This function should have running time proportional to the number of lists being appended.

Package

dlist

Source

modification.lisp (file)

Function: dlist-nth N DLIST &key FROM-END

Returns the nth element of ‘dlist’, as the primary value. If n is >= the length of the list, NIL will be returned. The secondary value will be T if the value was actually found in the list, and NIL otherwise. If ‘from-end’ is true, ‘dlist-nth’ returns the @code{n}th element from the end, subject to the rules above.

Package

dlist

Source

dlist.lisp (file)

Writer

(setf dlist-nth) (function)

Function: (setf dlist-nth) VAL N DLIST &key FROM-END

Sets the data of the nth dcons in ‘dlist’ to ‘val’. If ‘from-end’ is true, sets the @code{n}th element from the end.

Package

dlist

Source

dlist.lisp (file)

Reader

dlist-nth (function)

Function: dlist-reverse DLIST

Reverses dlist non-destructively.

Package

dlist

Source

more-ops.lisp (file)

Function: dlist= DLIST &rest MORE-DLISTS

Tests dlists for equality by element, recursively descending into sub-dlists.

Package

dlist

Source

dlist.lisp (file)

Function: dlistp OBJECT

Tests if ‘object’ is a dlist.

Package

dlist

Source

dlist.lisp (file)

Function: make-dlist SIZE &key INITIAL-ELEMENT

Creates a dlist that contains ‘initial-element’ ‘size’ times.

Package

dlist

Source

more-ops.lisp (file)

Function: mapdcon FUNCTION DLIST &rest MORE-DLISTS-AND-FROM-END

Maps ‘function’ over ‘dlist’ the dconses in ‘dlist’, then returns ‘dlist’

Package

dlist

Source

mapping.lisp (file)

Function: mapdcons FUNCTION DLIST &rest MORE-DLISTS-AND-FROM-END

Maps over the dconses in ‘dlist’ and ‘more-dlists’. If ‘more-dlists’ contains the keyword :from-end, the value after it in the argumnt list will be taken as the value of :from-end, and both will be removed from ‘more-dlists’. The order of elements in the result is the same as the oder in which the elements are returned from the function.

Package

dlist

Source

mapping.lisp (file)

Function: mapdlist FUNCTION DLIST &rest MORE-DLISTS-AND-FROM-END

Behaves like ‘mapdcons’, except the function will be passed the ‘data’ of each dcons.

Package

dlist

Source

mapping.lisp (file)

Function: next DCONS

Accesses the ‘next’ slot of a dcons. The ‘next’ of nil is nil.

Package

dlist

Source

dcons.lisp (file)

Writer

(setf next) (function)

Function: (setf next) VAL PLACE

Sets the ‘next’ slot of ‘place’ (which must be a ‘dcons’) to ‘val’

Package

dlist

Source

dcons.lisp (file)

Reader

next (function)

Function: nthdcons N DLIST &key FROM-END

Returns the @code{n}th dcons in ‘dlist’ (zero-based). If n is >= the length of the list, returns NIL. If ‘from-end’ is true, returns the @code{n}th dcons from the end.

Package

dlist

Source

dlist.lisp (file)

Function: prev DCONS

Accesses the ‘prev’ slot of a dcons. The ‘prev’ of nil is nil.

Package

dlist

Source

dcons.lisp (file)

Writer

(setf prev) (function)

Function: (setf prev) VAL PLACE

Sets the ‘prev’ slot of ‘place’ (which must be a ‘dcons’) to ‘val’

Package

dlist

Source

dcons.lisp (file)

Reader

prev (function)


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

5.1.3 Structures

Structure: dcons ()

A three-member cons cell for doubly-linked lists, which has ‘prev’, ‘data’ and ‘next’ slots

Package

dlist

Source

dcons.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: prev
Readers

dcons-prev (function)

Writers

(setf dcons-prev) (function)

Slot: data
Readers

dcons-data (function)

Writers

(setf dcons-data) (function)

Slot: next
Readers

dcons-next (function)

Writers

(setf dcons-next) (function)


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

5.1.4 Classes

Class: dlist ()

A class that represents a doubly-linked list

Package

dlist

Source

dlist.lisp (file)

Direct superclasses
  • standard-object (class)
  • sequence (class)
Direct methods
  • iterator-index (method)
  • iterator-element (method)
  • iterator-element (method)
  • iterator-endp (method)
  • iterator-step (method)
  • make-sequence-iterator (method)
  • reverse (method)
  • make-sequence-like (method)
  • adjust-sequence (method)
  • elt (method)
  • elt (method)
  • length (method)
  • describe-object (method)
  • print-object (method)
  • %dlist-last (method)
  • %dlist-last (method)
  • %dlist-first (method)
  • %dlist-first (method)
Direct slots
Slot: first
Initargs

:first

Readers

%dlist-first (generic function)

Writers

(setf %dlist-first) (generic function)

Slot: last
Initargs

:last

Readers

%dlist-last (generic function)

Writers

(setf %dlist-last) (generic function)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: copy-dcons INSTANCE
Package

dlist

Source

dcons.lisp (file)

Function: dcons-append OBJECT DCONS

Creates a dcons whose ‘data’ is ‘object’ and appends it to ‘dcons’, returning ‘dcons’ with a pointer to the new dcons in ‘dcons”s next.

Package

dlist

Source

dlist.lisp (file)

Function: dcons-data INSTANCE
Function: (setf dcons-data) VALUE INSTANCE
Package

dlist

Source

dcons.lisp (file)

Function: dcons-next INSTANCE
Function: (setf dcons-next) VALUE INSTANCE
Package

dlist

Source

dcons.lisp (file)

Function: dcons-p OBJECT
Package

dlist

Source

dcons.lisp (file)

Function: dcons-prev INSTANCE
Function: (setf dcons-prev) VALUE INSTANCE
Package

dlist

Source

dcons.lisp (file)

Function: dlist-cons-on OBJECT DLIST

Returns a dlist whose elements are ‘object’ and the elements of ‘dlist’. ‘dlist’ is destructively mosified. This is intended to have the same use as @code{(cons object list)} for regular lists.

Package

dlist

Source

dlist.lisp (file)

Function: make-dcons &key (PREV PREV) (DATA DATA) (NEXT NEXT)
Package

dlist

Source

dcons.lisp (file)


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

5.2.2 Generic functions

Generic Function: %dlist-first OBJECT
Generic Function: (setf %dlist-first) NEW-VALUE OBJECT
Package

dlist

Methods
Method: %dlist-first (DLIST dlist)

automatically generated reader method

Source

dlist.lisp (file)

Method: (setf %dlist-first) NEW-VALUE (DLIST dlist)

automatically generated writer method

Source

dlist.lisp (file)

Generic Function: %dlist-last OBJECT
Generic Function: (setf %dlist-last) NEW-VALUE OBJECT
Package

dlist

Methods
Method: %dlist-last (DLIST dlist)

automatically generated reader method

Source

dlist.lisp (file)

Method: (setf %dlist-last) NEW-VALUE (DLIST dlist)

automatically generated writer method

Source

dlist.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   D   F   L  
Index Entry  Section

D
dlist.asd: The dlist<dot>asd file
dlist/dcons.lisp: The dlist/dcons<dot>lisp file
dlist/dlist.lisp: The dlist/dlist<dot>lisp file
dlist/generic-sequences.lisp: The dlist/generic-sequences<dot>lisp file
dlist/mapping.lisp: The dlist/mapping<dot>lisp file
dlist/modification.lisp: The dlist/modification<dot>lisp file
dlist/more-ops.lisp: The dlist/more-ops<dot>lisp file
dlist/package.lisp: The dlist/package<dot>lisp file

F
File, Lisp, dlist.asd: The dlist<dot>asd file
File, Lisp, dlist/dcons.lisp: The dlist/dcons<dot>lisp file
File, Lisp, dlist/dlist.lisp: The dlist/dlist<dot>lisp file
File, Lisp, dlist/generic-sequences.lisp: The dlist/generic-sequences<dot>lisp file
File, Lisp, dlist/mapping.lisp: The dlist/mapping<dot>lisp file
File, Lisp, dlist/modification.lisp: The dlist/modification<dot>lisp file
File, Lisp, dlist/more-ops.lisp: The dlist/more-ops<dot>lisp file
File, Lisp, dlist/package.lisp: The dlist/package<dot>lisp file

L
Lisp File, dlist.asd: The dlist<dot>asd file
Lisp File, dlist/dcons.lisp: The dlist/dcons<dot>lisp file
Lisp File, dlist/dlist.lisp: The dlist/dlist<dot>lisp file
Lisp File, dlist/generic-sequences.lisp: The dlist/generic-sequences<dot>lisp file
Lisp File, dlist/mapping.lisp: The dlist/mapping<dot>lisp file
Lisp File, dlist/modification.lisp: The dlist/modification<dot>lisp file
Lisp File, dlist/more-ops.lisp: The dlist/more-ops<dot>lisp file
Lisp File, dlist/package.lisp: The dlist/package<dot>lisp file

Jump to:   D   F   L  

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

A.2 Functions

Jump to:   %   (  
C   D   F   G   M   N   P  
Index Entry  Section

%
%dlist-first: Internal generic functions
%dlist-first: Internal generic functions
%dlist-last: Internal generic functions
%dlist-last: Internal generic functions

(
(setf %dlist-first): Internal generic functions
(setf %dlist-first): Internal generic functions
(setf %dlist-last): Internal generic functions
(setf %dlist-last): Internal generic functions
(setf data): Exported functions
(setf dcons-data): Internal functions
(setf dcons-next): Internal functions
(setf dcons-prev): Internal functions
(setf dlist-first): Exported functions
(setf dlist-last): Exported functions
(setf dlist-nth): Exported functions
(setf next): Exported functions
(setf prev): Exported functions

C
copy-dcons: Internal functions
copy-dlist: Exported functions

D
data: Exported functions
dcons: Exported functions
dcons-append: Internal functions
dcons-data: Internal functions
dcons-next: Internal functions
dcons-p: Internal functions
dcons-prev: Internal functions
dconsp: Exported functions
dlist: Exported functions
dlist->list: Exported functions
dlist-append: Exported functions
dlist-cons-on: Internal functions
dlist-first: Exported functions
dlist-last: Exported functions
dlist-length: Exported functions
dlist-nconc: Exported functions
dlist-nth: Exported functions
dlist-pop: Exported macros
dlist-push: Exported macros
dlist-reverse: Exported functions
dlist=: Exported functions
dlistp: Exported functions
dodcons: Exported macros
dodlist: Exported macros

F
Function, (setf data): Exported functions
Function, (setf dcons-data): Internal functions
Function, (setf dcons-next): Internal functions
Function, (setf dcons-prev): Internal functions
Function, (setf dlist-first): Exported functions
Function, (setf dlist-last): Exported functions
Function, (setf dlist-nth): Exported functions
Function, (setf next): Exported functions
Function, (setf prev): Exported functions
Function, copy-dcons: Internal functions
Function, copy-dlist: Exported functions
Function, data: Exported functions
Function, dcons: Exported functions
Function, dcons-append: Internal functions
Function, dcons-data: Internal functions
Function, dcons-next: Internal functions
Function, dcons-p: Internal functions
Function, dcons-prev: Internal functions
Function, dconsp: Exported functions
Function, dlist: Exported functions
Function, dlist->list: Exported functions
Function, dlist-append: Exported functions
Function, dlist-cons-on: Internal functions
Function, dlist-first: Exported functions
Function, dlist-last: Exported functions
Function, dlist-length: Exported functions
Function, dlist-nconc: Exported functions
Function, dlist-nth: Exported functions
Function, dlist-reverse: Exported functions
Function, dlist=: Exported functions
Function, dlistp: Exported functions
Function, make-dcons: Internal functions
Function, make-dlist: Exported functions
Function, mapdcon: Exported functions
Function, mapdcons: Exported functions
Function, mapdlist: Exported functions
Function, next: Exported functions
Function, nthdcons: Exported functions
Function, prev: Exported functions

G
Generic Function, %dlist-first: Internal generic functions
Generic Function, %dlist-last: Internal generic functions
Generic Function, (setf %dlist-first): Internal generic functions
Generic Function, (setf %dlist-last): Internal generic functions

M
Macro, dlist-pop: Exported macros
Macro, dlist-push: Exported macros
Macro, dodcons: Exported macros
Macro, dodlist: Exported macros
make-dcons: Internal functions
make-dlist: Exported functions
mapdcon: Exported functions
mapdcons: Exported functions
mapdlist: Exported functions
Method, %dlist-first: Internal generic functions
Method, %dlist-last: Internal generic functions
Method, (setf %dlist-first): Internal generic functions
Method, (setf %dlist-last): Internal generic functions

N
next: Exported functions
nthdcons: Exported functions

P
prev: Exported functions

Jump to:   %   (  
C   D   F   G   M   N   P  

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

A.3 Variables

Jump to:   D   F   L   N   P   S  
Index Entry  Section

D
data: Exported structures

F
first: Exported classes

L
last: Exported classes

N
next: Exported structures

P
prev: Exported structures

S
Slot, data: Exported structures
Slot, first: Exported classes
Slot, last: Exported classes
Slot, next: Exported structures
Slot, prev: Exported structures

Jump to:   D   F   L   N   P   S  

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

A.4 Data types

Jump to:   C   D   P   S  
Index Entry  Section

C
Class, dlist: Exported classes

D
dcons: Exported structures
dlist: The dlist system
dlist: The dlist package
dlist: Exported classes
dlist-system: The dlist-system package

P
Package, dlist: The dlist package
Package, dlist-system: The dlist-system package

S
Structure, dcons: Exported structures
System, dlist: The dlist system

Jump to:   C   D   P   S