civodul pushed a commit to branch wip-haunt
in repository guix-artwork.

commit 6453e881ad42c0bfde1a18fd388500986d10cd59
Author: Ludovic Courtès <l...@gnu.org>
Date:   Tue Oct 25 18:06:13 2016 +0200

    website: download: Use 'match'.
    
    * website/www/download.scm (download-box): Use 'match-lambda' when
    traversing FILES.
---
 website/www/download.scm |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/website/www/download.scm b/website/www/download.scm
index 57aaffb..e8c58ef 100644
--- a/website/www/download.scm
+++ b/website/www/download.scm
@@ -22,6 +22,7 @@
 (define-module (www download)
   #:use-module (www utils)
   #:use-module (www shared)
+  #:use-module (ice-9 match)
   #:export (download-page))
 
 (define %usb-image-description
@@ -78,16 +79,18 @@ dependencies.")
         (h2 ,title)
         (p ,description)
         (p "Download options:")
-        ,(map (lambda (file)
-                `(a (@ (href ,(cdr file)) (class "hlink-download"))
-                   ,file))
+        ,(map (match-lambda
+                ((title . url)
+                 `(a (@ (href ,url) (class "hlink-download"))
+                     ,title)))
               files)
         (p "Signatures: "
-           ,(map (lambda (file)
-                   `(a (@ (href ,(string-append (cdr file) ".sig"))
-                          (class "hlink-signature"))
-                      ,(string-append (car file))))
-             files))
+           ,(map (match-lambda
+                   ((title . url)
+                    `(a (@ (href ,(string-append url ".sig"))
+                           (class "hlink-signature"))
+                        ,title)))
+                 files))
         (p (a (@ (href ,(guix-url manual)))
               "Installation instructions")
            ".")))

Reply via email to