nytpu.lisp-utils
2024-10-12
A collection of miscellaneous standalone utility packages.
Lisp-Utils
A collection of miscellaneous standalone utility packages for Common Lisp that I've written.
An ASDF system definition exists in
nytpu.lisp-utils.asd
,
but it is mostly for convenience and every file listed in
Documentation
is standalone and can be loaded or copied individually.
There are also zero external dependencies,
each file is entirely standalone.
It is available in
Quicklisp
under the system name
nytpu.lisp-utils
.
Or,
you can manually copy the files of interest into your project.
Documentation
nytpu.lisp-utils.bind
— A specialBIND
macro that looks likeLET
but supports destructuring, multiple value capture, sequential binding (LET*
-like), and usingWITH
-style functions likeWITH-OPEN-FILE
. Heavily inspired by Scott L. Burson's "New Let" and Ron Garret'sBINDING-BLOCK
, (readers will note that it's basically just features from the above macros but in a syntax I personally prefer, and also not shadowing stuff fromCOMMON-LISP
).nytpu.lisp-utils.shorthand-lambdas
— Allows enabling a new reader syntax, when prefixing a form with^
will implicitly wrap it in aLAMBDA
, i.e.^(...)
→(lambda () ...)
. Inside that form, the symbol$
will insert a new argument. A symbol of format$number
will (re)use that index argument from the argument list (arguments are one-indexed).nytpu.lisp-utils
— Miscellaneous trivial helper functions; such as a clone of Scheme's#;
to comment an entire s-expression, mutating version ofMAPCAR
(NMAPCAR
), and such. Also provides a helper function to enable all reader syntax extensions provided by theNYTPU.LISP-UTILS
system. Has an optional dependency onSHORTHAND-LAMBDAS
, if it is loaded thenENABLE-SYNTAXES
will enable the shorthand lambda reader syntax.
Contributing
Any contributions are welcome!
The upstream URL of this project is https://git.sr.ht/~nytpu/nytpu.lisp-utils. Send suggestions, bugs, patches, and other contributions to ~nytpu/[email protected] or <alex [at] nytpu.com>. For help sending a patch through email, see https://git-send-email.io.
If you aren't comfortable sending a patch through email, get in touch with a link to your version of the repo and I'll pull the changes down myself!
Copyright
Copyright (C) 2022-2024 nytpu <alex [at] nytpu.com>.
Licensed under the terms of the Mozilla Public License version 2.0. You can view a copy of the MPL in LICENSE or at https://www.mozilla.org/en-US/MPL/2.0/.