From: David Kastrup Date: Sat, 5 Apr 2014 13:44:18 +0000 (+0200) Subject: Issue 3897: Some spring cleaning mostly concerning cumbersome apply calls X-Git-Tag: release/2.19.5-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0a71592e9a7b4e43e08fb8b0012c831bf6513cbb;p=lilypond.git Issue 3897: Some spring cleaning mostly concerning cumbersome apply calls Also replaced some uses of zip with multi-list map. --- diff --git a/scm/document-markup.scm b/scm/document-markup.scm index 2eca8cc7d7..318a26b9e6 100644 --- a/scm/document-markup.scm +++ b/scm/document-markup.scm @@ -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 diff --git a/scm/lily-library.scm b/scm/lily-library.scm index c78b8816c0..78144ec244 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -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) diff --git a/scm/lily.scm b/scm/lily.scm index 47e88eef9f..5d230d8f7e 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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" diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 60ad51f281..d00757f4e2 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -71,10 +71,10 @@ (string-append "\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)))) diff --git a/scm/page.scm b/scm/page.scm index ab278a1dcb..8fa1f0e10e 100644 --- a/scm/page.scm +++ b/scm/page.scm @@ -82,16 +82,12 @@ (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))