In this place I collect all the little lisp functions and utilities which seem to be of general use in different projects. I took a lot of inspiration from ”On Lisp” by Paul Graham, and ”Let Over Lambda” by Doug Hoyte (both books heavily recommended).
The goal of this system is to provide some personalised/personalisable lisp utilities for myself. Originally, everything should be self-contained (without any dependencies), however mid-term I would like to replace custom implementations with imports from other utility packages.
The main package which contains almost all the utilities. It has the nickname :OL
, in analogy to :CL
. There is also the :OL-USER
package, which I use as default REPL package instead of :CL-USER
.
It depends on some packages (available through Quicklisp):
- NAMED-READTABLES for defining
ol-readtable
(installed by default) - iterate (custom extensions)
- Alexandria
Utilities for CL-PREVALENCE (setting up stores) and functions for printing and parsing dates for LOCAL-TIME
Some utility functions for working with CLSQL, mainly related to date queries. It bridges between LOCAL-TIME data types and CLSQL data types.
I adapted a few of those suggested in “Let Over Lambda”, and have used them frequently.
The read-macros are loaded by default, probably loading the standard readtable should get rid of them again.
When working on particular projects, I sometimes write general utilities (as needed). When cleaning up code, they get proper documentation and get moved into the ol-utils
project.
As ol-utils
is used in all my projects, it provides a consistent environment for me when programming Common Lisp.
- packages
- basics
- string and symbol building, list utilities required for macros
- reader
- read macros
- macrodef
defmacro!
and friends- binding
- shorter aliases for binding macros
- conditionals
while%
and related- anaphoric
- my favourite anaphoric macros
- setf
- sequences
- functions
- composition and variation of
lambda
- lists
- list building/transformation and access, queues and custom mapping functions
- trees
- basic tree walking
- memoisation
- memoisation functions/macros using both hash-tables and arrays
- lazy
- lazy evaluation and pipes
- arrays
- (sub)array iteration and filling (also for multidimensional arrays)
- lazy-array
- infinite length arrays (vectors), see also math-utils
- nlazy-array
- lazy array API ported to normal arrays
- infinite
- a simpler approach to infinite arrays
- strings
- arithmetic
- tables
- hash-table access helper, converting between alists and hash-tables
- clos
- files
- iterating on lines of a file
- applications
- a function to quickly launch my lisp applications
- portability
Check out Alexandria and other utility collections.
A large part functions are so simple that testing does not make sense. It is unlikely I would change them, and their correctness is obvious from the definition.
However testing would be a good idea for some of the more complicated functions.
also a header for each file