emacs: Stylistic improvements in guile code.
* emacs/guix-main.scm (package-unique?): Use 'match' instead of 'cdr'. (package-by-address): Likewise.
This commit is contained in:
parent
5f2928456b
commit
f1f09937a6
|
@ -293,8 +293,10 @@ Example:
|
||||||
|
|
||||||
(define (package-unique? package)
|
(define (package-unique? package)
|
||||||
"Return #t if PACKAGE is a single package with such name/version."
|
"Return #t if PACKAGE is a single package with such name/version."
|
||||||
(null? (cdr (packages-by-name (package-name package)
|
(match (packages-by-name (package-name package)
|
||||||
(package-version package)))))
|
(package-version package))
|
||||||
|
((package) #t)
|
||||||
|
(_ #f)))
|
||||||
|
|
||||||
(define %package-param-alist
|
(define %package-param-alist
|
||||||
`((id . ,object-address)
|
`((id . ,object-address)
|
||||||
|
@ -330,8 +332,9 @@ Example:
|
||||||
;;; Finding packages.
|
;;; Finding packages.
|
||||||
|
|
||||||
(define (package-by-address address)
|
(define (package-by-address address)
|
||||||
(and=> (vhash-assq address %packages)
|
(match (vhash-assq address %packages)
|
||||||
cdr))
|
((_ . package) package)
|
||||||
|
(_ #f)))
|
||||||
|
|
||||||
(define (packages-by-name+version name version)
|
(define (packages-by-name+version name version)
|
||||||
(or (hash-ref %package-table
|
(or (hash-ref %package-table
|
||||||
|
|
Loading…
Reference in New Issue