CL-SDM
CL-SDM is my personal standard library for Common Lisp. It’s not quite at v1.0 yet, and is written in a rather opinionated way. Most of my other Common Lisp projects use it in some way or another.
Features
- Core
- [x] XOR logic function.
- [x] Nicer constant declarations.
- [x] PARSE-INTEGER? that returns NIL instead of raising a condition when it can’t parse.
- [x] Shorter type names for the common (un)signed integer types
- [x] Shorter array/vector declarations
- [x] Pseudo-enums (code is already written, just needs moving to CL-SDM and some expansion)
- [x] DEFINE-TYPED-FN ported from my CL-MeltySynth program and expanded
- [/] Support for &key, &optional, and &rest in DEFINE-TYPED-FN
- [x] Conversion to/from (un)signed integers
- [x] CLAMP macro
- [x] MAPAPPEND function
- [x] Various nice functions inspired by Crystal/Ruby for inspecting sequences.
- [x] SAMPLE function
- [x] Sequence shuffling
- [x] SHIFT functions
- [x] Generic DOSEQ macro
- [x] Equivalent of LAST for any sequence type.
- [x] SWAP function
- [x] Easier string trimming
- [x] Caseless string comparisons
- [x] CASE-like statement for strings
- [x] Easier concatenation of things to a string
- [x] Print numbers as binary sizes (KiB, MiB, etc).
- [x] String spitting
- [x] Pretty string indenting
- [x] STRING-REPLACE
- [x] STRING-STARTS-WITH and -ENDS-WITH
- [x] JOIN function for strings
- [x] Fast approximate trig functions
- Argument Parsing
- [x] Support short (
-s
) and long (--long
) arguments. - [x] Automatic –help and –version handling
- [x] Custom help/version printing
- [x] Positional arg support
- [x] Fast parsing of arguments
- [x] Call arbitrary functions to check argument values
- [x] String arguments
- [x] Flag arguments
- [x] File arguments (like strings, but with some special handling)
- [x] Numeric arguments
- [ ] Make positional arg support optional
- [ ] Optionally allow - and – as arguments
- [x] Support short (
- I/O
- [x] Fast I/O functions for reading/writing integers in binary.
- [x] Fast I/O functions for reading/writing floats in binary.
- [x] Fast I/O functions for reading/writing strings in binary.
- [x] Conversion of strings to/from sequences of bytes.
- [x] Conversion of integers to/from sequences of bytes.
- [ ] Conversion of floats to/from sequences of bytes.
- [x] 24-bit integer support in the I/O functions
- Date/Time
- [x] Date/Time arithmetic
- [x] Time Spans
- [ ] Support fractional seconds
- [ ] Time Span -> String conversions
- [x] Date Time -> String conversions
- Terminal Handling
- [x] Basic ANSI support for colors and cursor control
- [x] Progress bar
- [x] Support for the Terminology terminal
- [ ] Windows support
- Files/Pathnames
- [x] Basename
- [x] Check for existing directory
- [x] Get file size
- [x] Check if a path points to a directory or not
- [x] Get some basic info (last modified, mode, etc.)
- Logging
- [x] Tag-based logging, where tags can be muffled.
- [x] Basic logger
- [x] Logger with colored output
- [ ] Multi-logger (write to a logger once, and the strings go to 1+ destinations)
- [ ] Concurrent logger