My bag of miscellaneous Common Lisp utilities. Designed to complement cleanly CL and ALEXANDRIA.
To do:
-
MORE TESTS!
-
Add type declarations where appropriate
-
Some more/better doc
-
Use %rel-end %rel-start everywhere in sequence and strings
-
macros: add env and use in subtypep and co if needed
-
array/hash-table: add :defaults to make-*, like make-pathname, and alias (copy-* src ...)
to
(make-* :defaults src ...)
- array:
Copy contents only if :initial-element and :initial-contents aren't provided,
upgraded-array-element-type are compatible; add :extend-{element,contents} for when new
dimensions are larger than :defaults ?
- hash-table:
Use trivial-generic-hash-table, do copy :hash-function
-
coerce* pathname <-> string
-
queue/deque/stack:
-
alist/plist/hash-table:
- coercing between them (in coerce*); means recognizing "fantasy" type alist and plist via EQ
- map-through for alist/plist (actually replaces translate using hash-table)
- map[-into], map[-to-list], merge[-into] for alist/plist
-
list:
- sublist version of member (<=> cons-returning versions of search), KMP algo ?
- nrotate-{left,right}
- alexandria map-{combinations,permutations,derangements}: wrapper to return the sequences themselves
- append (instead of nconc) versions of mapcan/mapcon ? mapcap/mapcop ?
-
plist
- map (function (k v) -> (values newk newv))
-
array:
- Add count, [n]substitute, [n]translate, mismatch, reduce, {map,map-into,reduce}-coordinates
- Add :count where appropriate
-
vector:
- vector-append (adjust -> replace)
-
hash-table:
- Version of copy working with hash-function ?
-
sequence:
- Add {find,position,search}-nth
- nconcatenate, map[n]cat
- [n]translate: add start/end, compiler-macro to construct LUT/HT at build time,
a way to provide them to avoid rebuilding each time
-
clos:
- Add NIH defclass* with automatic print-object, copy-object and equal-object
-
misc:
-
rel-start-end:
- Optional '(:keyword count elem) to use {position,search}-nth
- Add function option, now that -any-of is gone
Emacs support:
- To highlight the λ reader macro in Emacs, add
(font-lock-add-keywords
'lisp-mode
'(("#[0-9]*λ" . font-lock-keyword-face)))
to init.el