]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3897: Some spring cleaning mostly concerning cumbersome apply calls
authorDavid Kastrup <dak@gnu.org>
Sat, 5 Apr 2014 13:44:18 +0000 (15:44 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 13 Apr 2014 17:20:22 +0000 (19:20 +0200)
Also replaced some uses of zip with multi-list map.

scm/document-markup.scm
scm/lily-library.scm
scm/lily.scm
scm/output-svg.scm
scm/page.scm

index 2eca8cc7d77286bf7adbbb84998299e6c4e50a60..318a26b9e60718108a78cdb4ab4f4ee6106602e8 100644 (file)
@@ -53,9 +53,9 @@
          (sig-type-names (map type-name sig))
          (signature-str
           (string-join
-           (map (lambda (x) (string-append
-                             "@var{" (car x) "} ("  (cadr x) ")" ))
-                (zip arg-names  sig-type-names))
+           (map (lambda (x y) (string-append
+                             "@var{" x "} (" y ")" ))
+                arg-names  sig-type-names)
            " " )))
 
     (string-append
index c78b8816c07f03631312afe5bf34b91617185be1..78144ec244dd8d7b852fcbe3ea848ff9f0f0bff4 100644 (file)
@@ -840,12 +840,12 @@ Handy for debugging, possibly turned off."
 ;;  x)
 
 (define-public (stderr string . rest)
-  (apply format (cons (current-error-port) (cons string rest)))
+  (apply format (current-error-port) string rest)
   (force-output (current-error-port)))
 
 (define-public (debugf string . rest)
   (if #f
-      (apply stderr (cons string rest))))
+      (apply stderr string rest)))
 
 (define (index-cell cell dir)
   (if (equal? dir 1)
index 47e88eef9f4ba19b1a8d338c37596914c4841da9..5d230d8f7eb9eef7439af897fe2d6418b1a81e46 100644 (file)
@@ -411,8 +411,8 @@ messages into errors.")
 (define-public (ergonomic-simple-format dest . rest)
   "Like ice-9's @code{format}, but without the memory consumption."
   (if (string? dest)
-      (apply simple-format (cons #f (cons dest rest)))
-      (apply simple-format (cons dest rest))))
+      (apply simple-format #f dest rest)
+      (apply simple-format dest rest)))
 
 (define format
   ergonomic-simple-format)
@@ -426,7 +426,7 @@ messages into errors.")
   v)
 
 (define-public (print . args)
-  (apply format (cons (current-output-port) args)))
+  (apply format (current-output-port) args))
 
 
 ;;; General settings.
@@ -750,7 +750,7 @@ messages into errors.")
 
 (define (dump-profile base last this)
   (let* ((outname (format #f "~a.profile" (dir-basename base ".ly")))
-         (diff (map (lambda (y) (apply - y)) (zip this last))))
+         (diff (map - this last)))
     (ly:progress "\nWriting timing to ~a..." outname)
     (format (open-file outname "w")
             "time: ~a\ncells: ~a\n"
index 60ad51f2814788d22008ab75d572fb9ee5f4f9c3..d00757f4e217c59d01d7e6d4f2d0fd7f864a9bea 100644 (file)
   (string-append "<!-- " s " -->\n"))
 
 (define-public (entity entity string . attributes-alist)
-  (if (equal? string "")
+  (if (string-null? string)
       (apply eoc entity attributes-alist)
       (string-append
-       (apply eo (cons entity attributes-alist)) string (ec entity))))
+       (apply eo entity attributes-alist) string (ec entity))))
 
 (define (offset->point o)
   (ly:format "~4f ~4f" (car o) (- (cdr o))))
index ab278a1dcb7c5cc55da89a83f9d57a1ddfef083f..8fa1f0e10e9f7e0188ed172e7a678e93886893c5 100644 (file)
 (define (page-translate-systems page)
   (for-each
 
-   (lambda (sys-off)
-     (let*
-         ((sys (car sys-off))
-          (off (cadr sys-off)))
+   (lambda (sys off)
+     (if (not (number? (ly:prob-property sys 'Y-offset)))
+         (ly:prob-set-property! sys 'Y-offset off)))
 
-       (if (not (number? (ly:prob-property sys 'Y-offset)))
-           (ly:prob-set-property! sys 'Y-offset off))))
-
-   (zip (page-property page 'lines)
-        (page-property page 'configuration))))
+   (page-property page 'lines)
+   (page-property page 'configuration)))
 
 (define (annotate-top-space first-system layout header-stencil stencil)
   (let* ((top-margin (ly:output-def-lookup layout 'top-margin))