~q3cpma/cl-utils

My bag of Common Lisp utilities
cl-fix: initial support for hash-table/alist/plist coercion
cl-fix: add coerce* and [e]typespeccase
rel-bounds: :until -> :to, clearer English

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~q3cpma/cl-utils
read/write
git@git.sr.ht:~q3cpma/cl-utils

You can also use your local clone with git send-email.

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:

    • conc/nconc ?
  • 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:

    • (cond-let var clauses)
  • 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