summary refs log tree commit diff
path: root/etc/system-tests.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-07-10 12:39:44 +0200
committerLudovic Courtès <ludo@gnu.org>2022-07-10 23:57:14 +0200
commit9fdc4b6c283c5aa5cf10205d87fb2c58b829b9d0 (patch)
tree9458f4783146777e11efb0de96aa6677fe5d73d0 /etc/system-tests.scm
parentbf0a646a5bcde489b602c58fbb63a93acb9d08f6 (diff)
downloadguix-9fdc4b6c283c5aa5cf10205d87fb2c58b829b9d0.tar.gz
monads: Add 'mparameterize'.
* etc/system-tests.scm (mparameterize): Move to...
* guix/monads.scm (mparameterize): ... here.
* tests/monads.scm ("mparameterize"): New test.
* .dir-locals.el (c-mode): Add it.
Diffstat (limited to 'etc/system-tests.scm')
-rw-r--r--etc/system-tests.scm15
1 files changed, 0 insertions, 15 deletions
diff --git a/etc/system-tests.scm b/etc/system-tests.scm
index de6f592dee..cd22b7e6d3 100644
--- a/etc/system-tests.scm
+++ b/etc/system-tests.scm
@@ -43,21 +43,6 @@ determined."
           (repository-close! repository))
         #f))))
 
-(define-syntax mparameterize
-  (syntax-rules ()
-    "This form implements dynamic scoping, similar to 'parameterize', but in a
-monadic context."
-    ((_ monad ((parameter value) rest ...) body ...)
-     (let ((old-value (parameter)))
-       (mbegin monad
-         ;; XXX: Non-local exits are not correctly handled.
-         (return (parameter value))
-         (mlet monad ((result (mparameterize monad (rest ...) body ...)))
-           (parameter old-value)
-           (return result)))))
-    ((_ monad () body ...)
-     (mbegin monad body ...))))
-
 (define (tests-for-current-guix source commit)
   "Return a list of tests for perform, using Guix built from SOURCE, a channel
 instance."