The phoe-toolbox Reference Manual

Table of Contents

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

The phoe-toolbox Reference Manual

This is the phoe-toolbox Reference Manual, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 09:33:39 2019 GMT+0.


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

1 Introduction

PHOE-TOOLBOX - A personal utility library

This is a collection of Lisp utilities that I have collected, and will have collected, over time.

All exported functions are expected to be documented.

PHOE-TOOLBOX/BAG

A bag is a simple data structure that allows the following:

Basically, if a stack is LIFO, if a queue is FIFO, then a bag is RIRO (random in, random out).

They are of type BAG and are created via MAKE-BAG. Contents of a bag are an unspecialized adjustable vector accessible via BAG-CONTENTS. You can BAG-INSERT an element into a bag, BAG-COUNT to get the element count, BAG-REMOVE an element from the bag and, additionally, BAG-COMPRESS the bag's internal vector.


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 phoe-toolbox

Author

MichaƂ "phoe" Herda <phoe@teknik.io>

License

BSD 2-clause

Description

A personal utility library

Dependencies
Source

phoe-toolbox.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 phoe-toolbox.asd

Location

phoe-toolbox.asd

Systems

phoe-toolbox (system)


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

3.1.2 phoe-toolbox/package.lisp

Parent

phoe-toolbox (system)

Location

package.lisp

Packages

phoe-toolbox


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

3.1.3 phoe-toolbox/phoe-toolbox.lisp

Dependency

package.lisp (file)

Parent

phoe-toolbox (system)

Location

phoe-toolbox.lisp

Exported Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 phoe-toolbox

Source

package.lisp (file)

Use List
Exported Definitions

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

5 Definitions

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


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

5.1 Exported definitions


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

5.1.1 Macros

Macro: check-boundp OBJECT SLOT-NAME

Asserts that the provided slot is bound.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: define-constructor (CLASS . KEYS) &body BODY

Defines an INITIALIZE-INSTANCE :AFTER method on the given object.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: define-print (OBJECT STREAM &key TYPE IDENTITY) &body BODY

Defines a PRINT-OBJECT method on the given object with inserting BODY inside PRINT-UNREADABLE-OBJECT.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: define-readable-print (OBJECT STREAM &key TYPE IDENTITY) &body BODY

Defines a PRINT-OBJECT method on the given object, which depends on the value of *PRINT-READABLY*. If it is true, then the object is printed using PRINT-INSTANCE-READABLY; else, it is printed with inserting BODY inside PRINT-UNREADABLE-OBJECT.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: fbind BINDINGS &body BODY

Binds the function objects in the function namespace.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: finalized-let* (&rest BINDINGS) &body BODY

Like LET*, except each variable binding is of form (var initform . forms) where FORMS will be evaluated when leaving the LET* by means of UNWIND-PROTECT. These forms will be evaluated from last binding to first.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: mod-decf PLACE DIVISOR &optional DELTA-FORM

Like DECF, except the final value set in PLACE is always a modulus modulo DIVISOR.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: mod-incf PLACE DIVISOR &optional DELTA-FORM

Like INCF, except the final value set in PLACE is always a modulus modulo DIVISOR.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: notf PLACE

Sets the value of PLACE to its logical negation and returns the new value.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: signals* CONDITION-TYPE N FORM

Testing macro analogous to 1AM:SIGNALS, except it does not perform a non-local transfer of control and therefore is not suitable for any code that makes calls to INVOKE-DEBUGGER. Instead, it allows the caller to assert that a condition of type CONDITION-TYPE was signaled exactly N times.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: wait (&optional TIMEOUT STEP) &body BODY

Evaluates BODY each STEP seconds until it evaluates to true, at which point it returns the value of BODY, or until TIMEOUT seconds pass, at which point it returns NIL.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: wait-until FORM &optional STEP

Evaluates BODY each STEP seconds until it evaluates to true, at which point it returns the value of BODY.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: with-input-from-binary (STREAM FILESPEC) &body BODY

Like WITH-OPEN-FILE, except with defaults suitable for reading from binary.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: with-output-to-binary (STREAM FILESPEC &key IF-DOES-NOT-EXIST) &body BODY

Like WITH-OPEN-FILE, except with defaults suitable for wriiting to binary.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Macro: with-temp-package &body BODY

Evaluates BODY with *PACKAGE* bound to a freshly created temporary package that will be deleted once control leaves the BODY, uninterning all symbols that were interned into it during that time.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)


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

5.1.2 Functions

Function: assoc-value-or-die ALIST KEY &key TEST

Like ALEXANDRIA:ASSOC-VALUE, except it signals an error if the value is not found.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: bound-slots-values INSTANCE

Given a generalized instance of STANDARD-OBJECT, returns a list of all slot names which are bound in that instance.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: cat &rest STRINGS

Concatenates targets into a string.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: catn &rest STRINGS

Concatenates targets into a string, inserting a newline between each of them.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: circular-graph-p EDGES

Accepts a list of directed edges (two-element lists of EQL-comparable nodes). If the graph does not contain a cycle, returns (VALUES NIL NIL). If the graph contains a cycle, returns (VALUES T VERTEX), where VERTEX is one of the vertices in the cycle.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: constantly* &rest ARGS

Like CONSTANTLY, except the returned closure may return multiple values, denoted by ARGS.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: count-digits INTEGER

Returns the number of digits in an integer, sans any sign.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: dsubseq SEQUENCE START &optional END

Like SUBSEQ, except the created array is an array displaced to SEQUENCE ~ and therefore shares structure with it.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: fformat STREAM FORMAT-STRING &rest FORMAT-ARGS

Acts like FORMAT, except it calls FORCE-OUTPUT on STREAM afterwards.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: get-unix-time ()

Returns the current Unix timestamp.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: gethash-or-die KEY HASH-TABLE &optional DEFAULT

Like GETHASH, except it signals an error if the value is not found.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: graph-roots EDGES

Accepts a list of directed edges (two-element lists of EQL-comparable nodes). Returns a list of root vertices (vertices that are not pointed at).

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: hexadecimal-string-p STRING

Returns true if the string contains only digits 0-9 and lowercase/uppercase characters #A-#F, false otherwise.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: identity* &rest ARGS

Like CONSTANTLY, except the list of ARGS is returned instead.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: make-dumped-stream INPUT-OUTPUT-STREAM &key DUMP-INPUT-STREAM DUMP-OUTPUT-STREAM

Returns a wrapper stream around the original stream. All data read from the wrapper stream is additionally sent to DUMP-INPUT-STREAM. All data written to the wrapper stream is additionally sent to the DUMP-OUTPUT-STREAM.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: multiple-value-mapcar FUNCTION &rest LISTS

Returns multiple lists of all multiple values returned by repeatedly applying FUNCTION to consecutive arguments from LISTS.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: nth-funcall FUNCTION COUNT ARGUMENT

Funcall FUNCTION composed COUNT times with itself on ARGUMENT.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: peek-char-no-hang &optional INPUT-STREAM EOF-ERROR-P EOF-VALUE RECURSIVE-P

Like PEEK-CHAR, except it immediately returns NIL if no character is available for reading on the input stream.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: print-hash-table-readably HASH-TABLE &optional STREAM

Prints a hash table readably using ALEXANDRIA:ALIST-HASH-TABLE.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: print-instance-readably OBJECT &optional STREAM

Prints an instance readably using the #. notation with MAKE-INSTANCE.

This function is a hack. Its functioning depends on all direct slots of a class being of form %FOO or FOO and having an initarg keyword called :FOO. All values stored in these slots need to be printable readably. Moreover, indirect slots are not restored. Before you use it, make sure you know what you are doing.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: rassoc-value-or-die ALIST KEY &key TEST

Like ALEXANDRIA:RASSOC-VALUE, except it signals an error if the value is not found.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: read-data-file SYSTEM PATHNAME

Reads the data file from the provided pathname. The pathname should be a system relative pathname.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: replace-all STRING PART REPLACEMENT &key TEST

Returns a new string in which all the occurences of the part is replaced with replacement.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: robust-subseq SEQUENCE START &optional END

Like SUBSEQ, but handles out-of-range bounding index designators gracefully.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: sleepcar FUNCTION LIST &optional N SLEEP-INTERVAL

Collects the element of funcalling FUNCTION on successive elements of LIST, sleeping for SLEEP-INTERVAL seconds every N elements.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: split PREDICATE LIST

Separates the list into a sublist of elements for which the predicate returns true and a sublist of elements for which the predicate returns false. Returns them as two values.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: string=-getf PLIST INDICATOR

Like GETF, except it tests with STRING= and is there suitable for use with strings and symbols.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: trim-whitespace STRING

Trims whitespace characters from both sides of a string.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: unintern-all-symbols TREE

Returns a copy of the provided tree, in which all symbols have been uninterned. The tree must not contain improper lists.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: unix-time-to-datestring UNIX-TIME

Decodes the unix time and returns its textual form in format "YYYY-MM-DD HH:MM:SS".

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: url-filename URL

Given a URL, returns everything after its last slash.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: urls-pathnames URLS DIRECTORY

Provided a list of URLs and a valid directory pathname, returns a list of pathnames that end with the filenames suitable for downloaded files.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: vector-times VECTOR N

Returns a fresh vector which is VECTOR concatenated to itself N times.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: whitespacep CHAR

Returns true if the provided character is whitespace.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)

Function: zip &rest LISTS

Collects a list of lists, where the first list contains the first element of the argument lists, the second list - second, etc.. The lists are as long as the shortest list.

Package

phoe-toolbox

Source

phoe-toolbox.lisp (file)


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, phoe-toolbox.asd: The phoe-toolbox<dot>asd file
File, Lisp, phoe-toolbox/package.lisp: The phoe-toolbox/package<dot>lisp file
File, Lisp, phoe-toolbox/phoe-toolbox.lisp: The phoe-toolbox/phoe-toolbox<dot>lisp file

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

P
phoe-toolbox.asd: The phoe-toolbox<dot>asd file
phoe-toolbox/package.lisp: The phoe-toolbox/package<dot>lisp file
phoe-toolbox/phoe-toolbox.lisp: The phoe-toolbox/phoe-toolbox<dot>lisp file

Jump to:   F   L   P  

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

A.2 Functions

Jump to:   A   B   C   D   F   G   H   I   M   N   P   R   S   T   U   V   W   Z  
Index Entry  Section

A
assoc-value-or-die: Exported functions

B
bound-slots-values: Exported functions

C
cat: Exported functions
catn: Exported functions
check-boundp: Exported macros
circular-graph-p: Exported functions
constantly*: Exported functions
count-digits: Exported functions

D
define-constructor: Exported macros
define-print: Exported macros
define-readable-print: Exported macros
dsubseq: Exported functions

F
fbind: Exported macros
fformat: Exported functions
finalized-let*: Exported macros
Function, assoc-value-or-die: Exported functions
Function, bound-slots-values: Exported functions
Function, cat: Exported functions
Function, catn: Exported functions
Function, circular-graph-p: Exported functions
Function, constantly*: Exported functions
Function, count-digits: Exported functions
Function, dsubseq: Exported functions
Function, fformat: Exported functions
Function, get-unix-time: Exported functions
Function, gethash-or-die: Exported functions
Function, graph-roots: Exported functions
Function, hexadecimal-string-p: Exported functions
Function, identity*: Exported functions
Function, make-dumped-stream: Exported functions
Function, multiple-value-mapcar: Exported functions
Function, nth-funcall: Exported functions
Function, peek-char-no-hang: Exported functions
Function, print-hash-table-readably: Exported functions
Function, print-instance-readably: Exported functions
Function, rassoc-value-or-die: Exported functions
Function, read-data-file: Exported functions
Function, replace-all: Exported functions
Function, robust-subseq: Exported functions
Function, sleepcar: Exported functions
Function, split: Exported functions
Function, string=-getf: Exported functions
Function, trim-whitespace: Exported functions
Function, unintern-all-symbols: Exported functions
Function, unix-time-to-datestring: Exported functions
Function, url-filename: Exported functions
Function, urls-pathnames: Exported functions
Function, vector-times: Exported functions
Function, whitespacep: Exported functions
Function, zip: Exported functions

G
get-unix-time: Exported functions
gethash-or-die: Exported functions
graph-roots: Exported functions

H
hexadecimal-string-p: Exported functions

I
identity*: Exported functions

M
Macro, check-boundp: Exported macros
Macro, define-constructor: Exported macros
Macro, define-print: Exported macros
Macro, define-readable-print: Exported macros
Macro, fbind: Exported macros
Macro, finalized-let*: Exported macros
Macro, mod-decf: Exported macros
Macro, mod-incf: Exported macros
Macro, notf: Exported macros
Macro, signals*: Exported macros
Macro, wait: Exported macros
Macro, wait-until: Exported macros
Macro, with-input-from-binary: Exported macros
Macro, with-output-to-binary: Exported macros
Macro, with-temp-package: Exported macros
make-dumped-stream: Exported functions
mod-decf: Exported macros
mod-incf: Exported macros
multiple-value-mapcar: Exported functions

N
notf: Exported macros
nth-funcall: Exported functions

P
peek-char-no-hang: Exported functions
print-hash-table-readably: Exported functions
print-instance-readably: Exported functions

R
rassoc-value-or-die: Exported functions
read-data-file: Exported functions
replace-all: Exported functions
robust-subseq: Exported functions

S
signals*: Exported macros
sleepcar: Exported functions
split: Exported functions
string=-getf: Exported functions

T
trim-whitespace: Exported functions

U
unintern-all-symbols: Exported functions
unix-time-to-datestring: Exported functions
url-filename: Exported functions
urls-pathnames: Exported functions

V
vector-times: Exported functions

W
wait: Exported macros
wait-until: Exported macros
whitespacep: Exported functions
with-input-from-binary: Exported macros
with-output-to-binary: Exported macros
with-temp-package: Exported macros

Z
zip: Exported functions

Jump to:   A   B   C   D   F   G   H   I   M   N   P   R   S   T   U   V   W   Z  

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

A.3 Variables


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

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, phoe-toolbox: The phoe-toolbox package
phoe-toolbox: The phoe-toolbox system
phoe-toolbox: The phoe-toolbox package

S
System, phoe-toolbox: The phoe-toolbox system

Jump to:   P   S