guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: utils: Add 'every*'.


From: Ludovic Courtès
Subject: 04/05: utils: Add 'every*'.
Date: Sat, 03 Oct 2015 15:09:13 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit 57aff6476e3d4c9a2df5ea98f2caaed1472972de
Author: Ludovic Courtès <address@hidden>
Date:   Sat Oct 3 12:28:58 2015 +0200

    utils: Add 'every*'.
    
    * guix/build/gnu-build-system.scm (every*): Move to...
    * guix/build/utils.scm (every*): ... here.  New procedure.
---
 guix/build/gnu-build-system.scm |   12 ------------
 guix/build/utils.scm            |   14 ++++++++++++++
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 0a774e1..75439c8 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -409,18 +409,6 @@ makefiles."
                                        strip-directories)))
                          outputs))))
 
-(define (every* pred lst)
-  "This is like 'every', but process all the elements of LST instead of
-stopping as soon as PRED returns false.  This is useful when PRED has side
-effects, such as displaying warnings or error messages."
-  (let loop ((lst    lst)
-             (result #t))
-    (match lst
-      (()
-       result)
-      ((head . tail)
-       (loop tail (and (pred head) result))))))
-
 (define* (validate-runpath #:key
                            (validate-runpath? #t)
                            (elf-directories '("lib" "lib64" "libexec"
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 9719296..e3f9edc 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -59,10 +59,12 @@
             list->search-path-as-string
             which
 
+            every*
             alist-cons-before
             alist-cons-after
             alist-replace
             modify-phases
+
             with-atomic-file-replacement
             substitute
             substitute*
@@ -454,6 +456,18 @@ PROGRAM could not be found."
 ;;; phases.
 ;;;
 
+(define (every* pred lst)
+  "This is like 'every', but process all the elements of LST instead of
+stopping as soon as PRED returns false.  This is useful when PRED has side
+effects, such as displaying warnings or error messages."
+  (let loop ((lst    lst)
+             (result #t))
+    (match lst
+      (()
+       result)
+      ((head . tail)
+       (loop tail (and (pred head) result))))))
+
 (define* (alist-cons-before reference key value alist
                             #:optional (key=? equal?))
   "Insert the KEY/VALUE pair before the first occurrence of a pair whose key



reply via email to

[Prev in Thread] Current Thread [Next in Thread]