guix-commits
[Top][All Lists]
Advanced

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

02/04: website: download: Use 'match'.


From: Ludovic Courtès
Subject: 02/04: website: download: Use 'match'.
Date: Tue, 25 Oct 2016 23:18:56 +0000 (UTC)

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

commit 86998b3cd0fbaf96f97b3cc7679fcd2f01c991a2
Author: Ludovic Courtès <address@hidden>
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

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