nytpu.lisp-utils
2023-06-18
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
(other than the convenience nytpu.lisp-utils.lisp
)
is entirely standalone.
Currently pending being added to Quicklisp,
currently the easiest way to use it is to clone the repository into
~/quicklisp/local-projects
,
or another location that ASDF/Quicklisp can locate it.
Or,
manually copying the files of interest into your project.
Documentation
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
).dbc
— Basic Design by Contract inspired by Ada's DbC design.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).comment-sexps
— Allows enabling a new reader syntax, prefixing any form (parenthesized expression or atom) with#;
will comment it out and cause it to be ignored, equivalently to the same comment syntax in Scheme.nytpu.lisp-utils
— Provides a helper function to enable all reader syntax extensions provided by theNYTPU.LISP-UTILS
system. The only package that depends on other packages, it depends onSHORTHAND-LAMBDAS
andCOMMENT-SEXPS
.
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/public-inbox@lists.sr.ht 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-2023 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/.