summaryrefslogtreecommitdiff
path: root/src/cuirass/utils.scm
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-02 15:49:34 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-02 15:49:34 +0200
commit13db5aa618761282f79eed0a541fc800178a4513 (patch)
tree065dcb241b7e13d64932c3865735844944400ec1 /src/cuirass/utils.scm
parent7ae6ce069070582e42b669d6a1ecfde5e9b998ba (diff)
downloadcuirass-13db5aa618761282f79eed0a541fc800178a4513.tar
cuirass-13db5aa618761282f79eed0a541fc800178a4513.tar.gz
λ all the things!
Diffstat (limited to 'src/cuirass/utils.scm')
-rw-r--r--src/cuirass/utils.scm19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index 48c4b12..f1ddbf5 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -23,11 +23,15 @@
#:export (;; Procedures
mkdir-p
;; Macros.
+ λ*
with-directory-excursion))
+(define-syntax-rule (λ* formals body ...)
+ (lambda* formals body ...))
+
(define mkdir-p
(let ((not-slash (char-set-complement (char-set #\/))))
- (lambda* (dir #:optional mode)
+ (λ* (dir #:optional mode)
"Create directory DIR and all its ancestors."
(let ((absolute? (string-prefix? "/" dir)))
(let loop ((components (string-tokenize dir not-slash))
@@ -36,12 +40,12 @@
((head tail ...)
(let ((dir-name (string-append root "/" head)))
(catch 'system-error
- (lambda ()
+ (λ ()
(if mode
(mkdir dir-name mode)
(mkdir dir-name))
(loop tail dir-name))
- (lambda args
+ (λ args
;; On GNU/Hurd we can get EROFS instead of EEXIST here.
;; Thus, if we get something other than EEXIST, check
;; whether DIR-NAME exists. See
@@ -57,9 +61,6 @@
"Run BODY with DIR as the process's current directory."
(let ((init (getcwd)))
(dynamic-wind
- (lambda ()
- (chdir dir))
- (lambda ()
- body ...)
- (lambda ()
- (chdir init)))))
+ (λ () (chdir dir))
+ (λ () body ...)
+ (λ () (chdir init)))))