mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
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.
This commit is contained in:
parent
6aaf3ea62d
commit
4b6fa8b339
2 changed files with 0 additions and 32 deletions
|
@ -85,7 +85,6 @@ (define-module (guix utils)
|
|||
fold2
|
||||
fold-tree
|
||||
fold-tree-leaves
|
||||
split
|
||||
cache-directory
|
||||
readlink*
|
||||
edit-expression
|
||||
|
@ -788,23 +787,6 @@ (define (fold-tree-leaves proc init children roots)
|
|||
(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")
|
||||
|
|
|
@ -122,20 +122,6 @@ (define temp-file
|
|||
'(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)
|
||||
|
|
Loading…
Reference in a new issue