The trivial-utilities Reference Manual

Table of Contents

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

The trivial-utilities Reference Manual

This is the trivial-utilities Reference Manual, version 0.3.8, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 10:00:05 2019 GMT+0.


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

1 Introduction

Trivial Utilities Manual

[in package TRIVIAL-UTILITIES]

pipeline status Quicklisp

Description

A collection of useful types, functions and macros.

Installing trivial-utilities

This project is available in the latest QuickLisp distribution, so installing it is reduced to calling:

(ql:quickload :trivial-utilities)

But if you want access to the latest updates, install it by cloning the Git repository with

cd $HOME/quicklisp/local-projects
git clone https://gitlab.com/ediethelm/trivial-utilities.git

and then loading it as usual via QuickLisp as above.

Commonly used types

From Graham's On Lisp

From Seibel's Practical Common Lisp

Other useful stuff

Example usage of PARTITION

(partition #'evenp '(1 2 3 4 5 6))
((2 4 6) (1 3 5))

Example output for DEMULTIPLEX

(demultiplex '((a b c) (x) (1 2)))
=> ((A X 1) (A X 2) (B X 1) (B X 2) (C X 1) (C X 2))

License Information

This library is released under the MIT License. Please refer to the LICENSE to get the full licensing text.

Contributing to this project

Please refer to the CONTRIBUTING document for more information.


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 trivial-utilities

Author

Eric Diethelm <ediethelm@yahoo.com>

License

MIT

Description

A collection of useful functions and macros.

Version

0.3.8

Dependencies
Source

trivial-utilities.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 trivial-utilities.asd

Location

trivial-utilities.asd

Systems

trivial-utilities (system)


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

3.1.2 trivial-utilities/package.lisp

Parent

trivial-utilities (system)

Location

package.lisp

Packages

trivial-utilities


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

3.1.3 trivial-utilities/trivial-utilities.lisp

Parent

trivial-utilities (system)

Location

trivial-utilities.lisp

Exported Definitions

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

3.1.4 trivial-utilities/documentation.lisp

Parent

trivial-utilities (system)

Location

documentation.lisp

Exported Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 trivial-utilities

trivial-utilities is a collection of useful functions and macros.

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 Special variables

Special Variable: @commonly-used-types
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @from-onlisp
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @from-pcl
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @other-useful-stuff
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @trivial-utilities-contributing
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @trivial-utilities-description
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @trivial-utilities-installing
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @trivial-utilities-license
Package

trivial-utilities

Source

documentation.lisp (file)

Special Variable: @trivial-utilities-manual
Package

trivial-utilities

Source

documentation.lisp (file)


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

5.1.2 Macros

Macro: aif TEST THEN &optional ELSE

Similar to the normal *IF*, but binds the result of *TEST* via *LET* to *IT*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: alambda PARMS &body BODY

Similar to *LAMBDA*, but defines *SELF* via *LABELS* which contains the *BODY*. *SELF* can be referenced in *BODY*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: aprog1 FIRST &body BODY

Similar to the normal *PROG1*, but binds the result of *FIRST* via *LET* to *IT* and returns *IT*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: aunless TEST &body ELSE

Similar to the normal *UNLESS*, but binds the result of *TEST* via *LET* to *IT*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: awhen TEST &body THEN

Similar to the normal *WHEN*, but binds the result of *TEST* via *LET* to *IT*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: blambda PARMS &body BODY

Similar to *LAMBDA*, but defines an unnamed *BLOCK* from which one can *RETURN*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: extract-additional-keys (KEYS ARGS) &body BODY

Convenience macro to extract keywords including default values from a plist, such as (:a 1 :b 2 :c 3). Usually used in conjunction with (&rest keys &key &allow-other-keys). *KEYS* - The keys to be extracted. This follows the syntax of **let**. Example: ((a nil) b (c t c-was-in-args-p))
*ARGS* - A property list of keyword-value pairs
*BODY* - Code to be executed and which uses the extracted keys.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Macro: once-only (&rest NAMES) &body BODY

Protects against multiple evaluation of *NAMES* during macro-expansion. Usualy used inside of other macros.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)


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

5.1.3 Functions

Function: all-slots CLASS

Create a list containing all slots defined for *class*, including slots defined (recursively) in all superclasses.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: collect-persistent-slots INSTANCE &key SLOTS-TO-IGNORE

Any slot which defines :initarg, is bound to a value and is not listed in *slots-to-ignore* will be appended in the form (initarg value).

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: demultiplex INPUT &optional BINDINGS

Given a *LIST* of *LIST*s returns all combinations of the elements in each of the *LIST*s in *INPUT*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: merge-lambda-lists &rest LISTS

Given two lambda lists, return one representing the unification of both.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: mklist OBJ

Returns a new list containing *OBJ*, or *OBJ* itself if it is already a list.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: mkstr &rest ARGS

Creates a string out of all elements in *ARGS*. Each element must be printable per *PRINC*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: partition PRED SEQ

Separates the contents of *SEQ* into two lists, depending on the result of *PRED* when applied to each element of *SEQ*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: single LST

Predicate verifying that *LST* is a list containing exactly one element.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Function: symb &rest ARGS

Creates a new and internalized *SYMBOL*, named by applying *MKSTR* to *ARGS*.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)


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

5.1.4 Generic functions

Generic Function: clone OBJ &key &allow-other-keys

A generic function to clone objects.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Generic Function: equals OBJ1 OBJ2 &key &allow-other-keys

A generic equality comparison function.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Methods
Method: equals OBJ1 OBJ2 &key &allow-other-keys

Default method if all other cases fail. Uses cl:equal for comparison.

Method: equals (OBJ1 null) (OBJ2 null) &key &allow-other-keys

Equality comparison of two *NULL* symbols always results in *NIL*.

Method: equals (OBJ1 list) (OBJ2 list) &key &allow-other-keys

Equality comparison of two *LIST*s requires both to have the same length and each element to be equaly comparable (*EQUALS*).

Method: equals (OBJ1 string) (OBJ2 string) &key &allow-other-keys

Equality comparison of two *STRING*s falls back to *string=*.

Generic Function: flatten OBJ

Flattens the structure of an object.

An implementation for *LIST*s already exists. Add specific implementations for special objects.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Methods
Method: flatten OBJ

Returns a list with the flatten contents of the *LIST* *OBJ*.


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

5.1.5 Types

Type: negative-fixnum ()

Defines all negative integer types upto and including -1.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Type: non-negative-fixnum ()

Defines all non-negative integer types starting from and including 0.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Type: non-positive-fixnum ()

Defines all non-positive integer types upto and including 0.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)

Type: positive-fixnum ()

Defines all positive integer types starting from and including 1.

Package

trivial-utilities

Source

trivial-utilities.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   T  
Index Entry  Section

F
File, Lisp, trivial-utilities.asd: The trivial-utilities<dot>asd file
File, Lisp, trivial-utilities/documentation.lisp: The trivial-utilities/documentation<dot>lisp file
File, Lisp, trivial-utilities/package.lisp: The trivial-utilities/package<dot>lisp file
File, Lisp, trivial-utilities/trivial-utilities.lisp: The trivial-utilities/trivial-utilities<dot>lisp file

L
Lisp File, trivial-utilities.asd: The trivial-utilities<dot>asd file
Lisp File, trivial-utilities/documentation.lisp: The trivial-utilities/documentation<dot>lisp file
Lisp File, trivial-utilities/package.lisp: The trivial-utilities/package<dot>lisp file
Lisp File, trivial-utilities/trivial-utilities.lisp: The trivial-utilities/trivial-utilities<dot>lisp file

T
trivial-utilities.asd: The trivial-utilities<dot>asd file
trivial-utilities/documentation.lisp: The trivial-utilities/documentation<dot>lisp file
trivial-utilities/package.lisp: The trivial-utilities/package<dot>lisp file
trivial-utilities/trivial-utilities.lisp: The trivial-utilities/trivial-utilities<dot>lisp file

Jump to:   F   L   T  

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

A.2 Functions

Jump to:   A   B   C   D   E   F   G   M   O   P   S  
Index Entry  Section

A
aif: Exported macros
alambda: Exported macros
all-slots: Exported functions
aprog1: Exported macros
aunless: Exported macros
awhen: Exported macros

B
blambda: Exported macros

C
clone: Exported generic functions
collect-persistent-slots: Exported functions

D
demultiplex: Exported functions

E
equals: Exported generic functions
equals: Exported generic functions
equals: Exported generic functions
equals: Exported generic functions
equals: Exported generic functions
extract-additional-keys: Exported macros

F
flatten: Exported generic functions
flatten: Exported generic functions
Function, all-slots: Exported functions
Function, collect-persistent-slots: Exported functions
Function, demultiplex: Exported functions
Function, merge-lambda-lists: Exported functions
Function, mklist: Exported functions
Function, mkstr: Exported functions
Function, partition: Exported functions
Function, single: Exported functions
Function, symb: Exported functions

G
Generic Function, clone: Exported generic functions
Generic Function, equals: Exported generic functions
Generic Function, flatten: Exported generic functions

M
Macro, aif: Exported macros
Macro, alambda: Exported macros
Macro, aprog1: Exported macros
Macro, aunless: Exported macros
Macro, awhen: Exported macros
Macro, blambda: Exported macros
Macro, extract-additional-keys: Exported macros
Macro, once-only: Exported macros
merge-lambda-lists: Exported functions
Method, equals: Exported generic functions
Method, equals: Exported generic functions
Method, equals: Exported generic functions
Method, equals: Exported generic functions
Method, flatten: Exported generic functions
mklist: Exported functions
mkstr: Exported functions

O
once-only: Exported macros

P
partition: Exported functions

S
single: Exported functions
symb: Exported functions

Jump to:   A   B   C   D   E   F   G   M   O   P   S  

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

A.3 Variables

Jump to:   @  
S  
Index Entry  Section

@
@commonly-used-types: Exported special variables
@from-onlisp: Exported special variables
@from-pcl: Exported special variables
@other-useful-stuff: Exported special variables
@trivial-utilities-contributing: Exported special variables
@trivial-utilities-description: Exported special variables
@trivial-utilities-installing: Exported special variables
@trivial-utilities-license: Exported special variables
@trivial-utilities-manual: Exported special variables

S
Special Variable, @commonly-used-types: Exported special variables
Special Variable, @from-onlisp: Exported special variables
Special Variable, @from-pcl: Exported special variables
Special Variable, @other-useful-stuff: Exported special variables
Special Variable, @trivial-utilities-contributing: Exported special variables
Special Variable, @trivial-utilities-description: Exported special variables
Special Variable, @trivial-utilities-installing: Exported special variables
Special Variable, @trivial-utilities-license: Exported special variables
Special Variable, @trivial-utilities-manual: Exported special variables

Jump to:   @  
S  

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

A.4 Data types

Jump to:   N   P   S   T  
Index Entry  Section

N
negative-fixnum: Exported types
non-negative-fixnum: Exported types
non-positive-fixnum: Exported types

P
Package, trivial-utilities: The trivial-utilities package
positive-fixnum: Exported types

S
System, trivial-utilities: The trivial-utilities system

T
trivial-utilities: The trivial-utilities system
trivial-utilities: The trivial-utilities package
Type, negative-fixnum: Exported types
Type, non-negative-fixnum: Exported types
Type, non-positive-fixnum: Exported types
Type, positive-fixnum: Exported types

Jump to:   N   P   S   T