summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2022-01-19 16:24:30 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2022-01-19 16:26:14 +0100
commit4d7a997ee147acf82c8ca510c0ecd3f520ea74f4 (patch)
tree9c47d10ce141f154d3d1d7770f8853d3078f039b /gnu
parentf52c4dc82a1ec4a572e50ea4d56e6f4ab9796978 (diff)
gnu: Add nhooks.
* gnu/packages/lisp-xyz.scm (cl-nhooks, ecl-nhooks, sbcl-nhooks): New variables.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/lisp-xyz.scm53
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 2d774463f6b..f7454d1cc4d 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -20323,3 +20323,56 @@ Lisp. A subsystem offers an experimental GUI Gemini client.")
20323 20323
20324(define-public ecl-phos 20324(define-public ecl-phos
20325 (sbcl-package->ecl-package sbcl-phos)) 20325 (sbcl-package->ecl-package sbcl-phos))
20326
20327(define-public sbcl-nhooks
20328 (package
20329 (name "sbcl-nhooks")
20330 (version "1.0.0")
20331 (source
20332 (origin
20333 (method git-fetch)
20334 (uri (git-reference
20335 (url "https://github.com/atlas-engineer/nhooks")
20336 (commit version)))
20337 (file-name (git-file-name "nhooks" version))
20338 (sha256
20339 (base32
20340 "1v3gh9jf4hbpl1hnyzhkrcj3jdh3q0mlp1n6ci2cbn2rsc65baff"))))
20341 (build-system asdf-build-system/sbcl)
20342 (inputs
20343 (list sbcl-serapeum))
20344 (native-inputs
20345 (list sbcl-fiveam))
20346 (home-page "https://github.com/atlas-engineer/nhooks")
20347 (synopsis "Hook facility for Common Lisp")
20348 (description "This package holds an enhanced implementation of
20349hooks (extension points). It works similarly to Emacs hooks with crucial
20350improvements:
20351
20352@itemize
20353
20354@item If the compiler allows it (such as SBCL), type-checking is performed at
20355compile-time and at run-time when adding handlers to a hook.
20356
20357@item On failure, multiple restarts are offered, such as disabling the
20358offending handler or simply continuing to the next function.
20359
20360@item The hook handler execution order and combination can be customized.
20361
20362@item Anonymous functions (lambdas) can be added to hooks as handler objects.
20363When inspecting hooks, readable names are thus exposed instead of lambda
20364blackboxes. Handlers are compared through their names (through the mandatory
20365name slot). A hook can not contain multiple handlers with the same name.
20366
20367@item A special provision is taken for “setters”, handlers that are meant to
20368set a given place to a given values. Such handler objects can be compared and
20369identified uniquely.
20370
20371@end itemize\n")
20372 (license license:expat)))
20373
20374(define-public cl-nhooks
20375 (sbcl-package->cl-source-package sbcl-nhooks))
20376
20377(define-public ecl-nhooks
20378 (sbcl-package->ecl-package sbcl-nhooks))