aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-30 22:57:49 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-30 23:08:39 +0200
commite58911de37f600dffce3c562ff1d26809343d420 (patch)
tree7f180bc8a579e2301dbb50fde2a3a6f18ce5f8b7 /src
parentac4512897c6e08f26f87d9b7ddd9120436610513 (diff)
downloadcuirass-e58911de37f600dffce3c562ff1d26809343d420.tar
cuirass-e58911de37f600dffce3c562ff1d26809343d420.tar.gz
utils: Add 'alist?' procedure.
* src/cuirass/utils.scm (alist?): New procedure. * tests/utils.scm ("alist?"): New test.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/utils.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index 1667c02..56b9c6a 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -20,7 +20,9 @@
(define-module (cuirass utils)
#:use-module (ice-9 match)
+ #:use-module (srfi srfi-1)
#:export (;; Procedures
+ alist?
mkdir-p
make-user-module
;; Macros.
@@ -30,6 +32,11 @@
(define-syntax-rule (λ* formals body ...)
(lambda* formals body ...))
+(define (alist? obj)
+ "Return #t if OBJ is an alist."
+ (and (list? obj)
+ (every pair? obj)))
+
(define mkdir-p
(let ((not-slash (char-set-complement (char-set #\/))))
(λ* (dir #:optional mode)