summary refs log tree commit diff
path: root/gnu/packages/lisp-xyz.scm
diff options
context:
space:
mode:
authorCharles <charles.b.jackson@protonmail.com>2021-06-26 09:56:20 -0500
committerGuillaume Le Vaillant <glv@posteo.net>2021-07-03 14:27:37 +0200
commit3c3c1a9ed51cfed2d0ebbbcd667cbe01fba6cc5e (patch)
treedfc923e43792f1fe84b33b7e097665cfeff42295 /gnu/packages/lisp-xyz.scm
parent70387700b284a73ed4757d7b0ddfe8eb09cb7a84 (diff)
downloadguix-3c3c1a9ed51cfed2d0ebbbcd667cbe01fba6cc5e.tar.gz
gnu: Add cl-tailrec.
* gnu/packages/lisp-xyz.scm (sbcl-tailrec, ecl-tailrec, cl-tailrec): New
  variables.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
Diffstat (limited to 'gnu/packages/lisp-xyz.scm')
-rw-r--r--gnu/packages/lisp-xyz.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 3dc276d057..8a1c441f9c 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -18202,3 +18202,37 @@ concept of a source-form to report where the error or warning is located.")
 
 (define-public cl-trivial-with-current-source-form
   (sbcl-package->cl-source-package sbcl-trivial-with-current-source-form))
+
+(define-public sbcl-tailrec
+  (let ((commit "a7cf91ef7bd73c118e96817e809a7ae587d4673f")
+        (revision "1"))
+    (package
+      (name "sbcl-tailrec")
+      (version (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/charje/tailrec")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0a25xa2kqai480micv8ap5bg4pz1dg7q3lz61g1ygim96cdjpwhl"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("alexandia" ,sbcl-alexandria)
+         ("trivial-macroexpand-all" ,sbcl-trivial-macroexpand-all)
+         ("trivial-with-current-source-form"
+          ,sbcl-trivial-with-current-source-form)))
+      (home-page "https://github.com/charje/tailrec")
+      (synopsis "Macro to optimize a Common Lisp function for tail recursion")
+      (description "Just wrap your Common Lisp function in this macro call and
+it will be optimized for tail recursion.  You will be warned if the function
+is not tail recursive.")
+      (license license:llgpl))))
+
+(define-public ecl-tailrec
+  (sbcl-package->ecl-package sbcl-tailrec))
+
+(define-public cl-tailrec
+  (sbcl-package->cl-source-package sbcl-tailrec))