[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/09: utils: Remove 'split'.
From: |
Ludovic Courtès |
Subject: |
03/09: utils: Remove 'split'. |
Date: |
Wed, 04 May 2016 21:37:21 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 4b6fa8b33970be414ae035f63ed80b147dcd8200
Author: Ludovic Courtès <address@hidden>
Date: Wed May 4 17:02:15 2016 +0200
utils: Remove 'split'.
This procedure was redundant with SRFI-1's 'break'.
* guix/utils.scm (split): Remove.
* tests/utils.scm ("split, element is in list")
("split, element is not in list"): Remove.
---
guix/utils.scm | 18 ------------------
tests/utils.scm | 14 --------------
2 files changed, 32 deletions(-)
diff --git a/guix/utils.scm b/guix/utils.scm
index 6c01edd..725f434 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -85,7 +85,6 @@
fold2
fold-tree
fold-tree-leaves
- split
cache-directory
readlink*
edit-expression
@@ -788,23 +787,6 @@ are connected to NODE in the tree, or '() or #f if NODE is
a leaf node."
(else result)))
init children roots))
-(define (split lst e)
- "Return two values, a list containing the elements of the list LST that
-appear before the first occurence of the object E and a list containing the
-elements after E."
- (define (same? x)
- (equal? e x))
-
- (let loop ((rest lst)
- (acc '()))
- (match rest
- (()
- (values lst '()))
- (((? same?) . tail)
- (values (reverse acc) tail))
- ((head . tail)
- (loop tail (cons head acc))))))
-
(define (cache-directory)
"Return the cache directory for Guix, by default ~/.cache/guix."
(or (getenv "XDG_CONFIG_HOME")
diff --git a/tests/utils.scm b/tests/utils.scm
index d0ee02a..854999f 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -122,20 +122,6 @@
'(0 1 2 3)))
list))
-(test-equal "split, element is in list"
- '((foo) (baz))
- (call-with-values
- (lambda ()
- (split '(foo bar baz) 'bar))
- list))
-
-(test-equal "split, element is not in list"
- '((foo bar baz) ())
- (call-with-values
- (lambda ()
- (split '(foo bar baz) 'quux))
- list))
-
(test-equal "strip-keyword-arguments"
'(a #:b b #:c c)
(strip-keyword-arguments '(#:foo #:bar #:baz)
- branch master updated (af5640d -> e9f693d), Ludovic Courtès, 2016/05/04
- 06/09: gnu: java-qdox: Escape "@" in description., Ludovic Courtès, 2016/05/04
- 02/09: environment: Use 'break' instead of 'split'., Ludovic Courtès, 2016/05/04
- 03/09: utils: Remove 'split'.,
Ludovic Courtès <=
- 05/09: build: Preserve stderr for shell tests., Ludovic Courtès, 2016/05/04
- 01/09: services: herd: Move UI handling to 'guix system'., Ludovic Courtès, 2016/05/04
- 07/09: system: Add procedures to access user accounts and service names., Ludovic Courtès, 2016/05/04
- 08/09: Add (gnu tests) and (gnu build marionette)., Ludovic Courtès, 2016/05/04
- 09/09: tests: Add whole-system test., Ludovic Courtès, 2016/05/04
- 04/09: utils: Move combinators to (guix combinators)., Ludovic Courtès, 2016/05/04