From 1b29d0ce3e3143bdc26504917578dc3f8b07e861 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Wed, 19 Oct 2016 22:50:40 +0200 Subject: [PATCH] Issue 4985: Avoid a few trivial lambda function wrappers --- ...tches-with-minimum-accidentals-smart-transpose.ly | 2 +- ly/articulate.ly | 12 ++++++------ ly/music-functions-init.ly | 4 +--- scm/chord-name.scm | 2 +- scm/define-markup-commands.scm | 2 +- scm/define-music-display-methods.scm | 2 +- scm/documentation-lib.scm | 3 +-- scm/modal-transforms.scm | 4 +--- scm/music-functions.scm | 4 +--- scm/stencil.scm | 2 +- 10 files changed, 15 insertions(+), 22 deletions(-) diff --git a/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly b/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly index 51ebe92078..df6ce9d6c0 100644 --- a/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly +++ b/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly @@ -62,7 +62,7 @@ In this manner, the most natural enharmonic notes are chosen. (if (pair? es) (ly:music-set-property! music 'elements - (map (lambda (x) (naturalize x)) es))) + (map naturalize es))) (if (ly:music? e) (ly:music-set-property! music 'element diff --git a/ly/articulate.ly b/ly/articulate.ly index 0414bd926b..0f198ffbed 100644 --- a/ly/articulate.ly +++ b/ly/articulate.ly @@ -425,7 +425,7 @@ (map (lambda (y) (ac:setduration y hemisemidur)) (ly:music-property music 'elements)) (set! uppernote (ly:music-deep-copy music)) - (map (lambda (y) (ac:up y)) + (map ac:up (filter (lambda (z) (eq? 'NoteEvent (ly:music-property z 'name))) (ly:music-property uppernote 'elements))) @@ -764,11 +764,11 @@ (ly:music-property abovenote 'elements)) (map (lambda (y) (ac:setduration y gracedur)) (ly:music-property abovenoteTwo 'elements)) - (map (lambda (y) (ac:up y)) + (map ac:up (filter (lambda (z) (eq? 'NoteEvent (ly:music-property z 'name))) (ly:music-property abovenote 'elements))) - (map (lambda (y) (ac:up y)) + (map ac:up (filter (lambda (z) (eq? 'NoteEvent (ly:music-property z 'name))) (ly:music-property abovenoteTwo 'elements))) @@ -788,7 +788,7 @@ (ly:music-property gracenote 'elements)) (map (lambda (y) (ac:setduration y gracedur)) (ly:music-property belownote 'elements)) - (map (lambda (y) (ac:down y)) + (map ac:down (filter (lambda (z) (eq? 'NoteEvent (ly:music-property z 'name))) (ly:music-property belownote 'elements))) @@ -812,11 +812,11 @@ (below (ly:music-deep-copy music)) (newmusic (make-sequential-music (list above music below music)))) (begin - (map (lambda (y) (ac:down y)) + (map ac:down (filter (lambda (z) (eq? 'NoteEvent (ly:music-property z 'name))) (ly:music-property below 'elements))) - (map (lambda (y) (ac:up y)) + (map ac:up (filter (lambda (z) (eq? 'NoteEvent (ly:music-property z 'name))) (ly:music-property above 'elements))) diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 76c2ec64b8..d96e655370 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -1651,9 +1651,7 @@ appropriate tweak applied.") (define (offset-control-points offsets) (if (null? offsets) coords - (map - (lambda (x y) (coord-translate x y)) - coords offsets))) + (map coord-translate coords offsets))) (define (helper sibs offs) (if (pair? offs) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 52ae72b2cb..29ec16fc80 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -169,4 +169,4 @@ FOOBAR-MARKUP) if OMIT-ROOT is given and non-false. (let* ((elts (filter is-event-chord? (ly:music-property seq 'elements))) (alist (map chord-to-exception-entry elts))) - (filter (lambda (x) (cdr x)) alist))) + (filter cdr alist))) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index bf9b9b4dd4..9ed4f9cc83 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -383,7 +383,7 @@ Its appearance may be customized by overrides for @code{thickness}, ;; The final stencil: lined-up bows (apply ly:stencil-add (map - (lambda (stil pt) (ly:stencil-translate stil pt)) + ly:stencil-translate (circular-list init-bow-up init-bow-down) list-of-starts)))) diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index 42637cd16c..a5ccd92849 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -628,7 +628,7 @@ Otherwise, return #f." (format #f "~s" string) string)) (markup->lily-string text))) - (map-in-order (lambda (m) (music->lily-string m)) + (map-in-order music->lily-string (ly:music-property lyric 'articulations)))) (define-display-method BreathingEvent (event) diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm index d5f4517326..685dc500d3 100644 --- a/scm/documentation-lib.scm +++ b/scm/documentation-lib.scm @@ -51,8 +51,7 @@ "\n\n" (if (pair? (node-children node)) (texi-menu - (map (lambda (x) (menu-entry x)) - (node-children node))) + (map menu-entry (node-children node))) "")) port) (for-each (lambda (x) (dump-node x port (+ 1 level))) diff --git a/scm/modal-transforms.scm b/scm/modal-transforms.scm index f9e26ed360..70c813e8e6 100644 --- a/scm/modal-transforms.scm +++ b/scm/modal-transforms.scm @@ -142,9 +142,7 @@ Typically used to construct a scale for input to (list pitch)) ((pair? elements) - (append-map - (lambda (x) (make-scale x)) - elements)) + (append-map make-scale elements)) ((ly:music? element) (make-scale element))))) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index dd91962462..3e9818d009 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -2313,9 +2313,7 @@ list or if there is a type-mismatch, @var{arg} will be returned." (number-pair? offsets))) (coord-translate arg offsets)) ((and (number-pair-list? arg) (number-pair-list? offsets)) - (map - (lambda (x y) (coord-translate x y)) - arg offsets)) + (map coord-translate arg offsets)) (else arg))) (define-public (grob-transformer property func) diff --git a/scm/stencil.scm b/scm/stencil.scm index 17f5f9084f..433bf634d8 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -1130,7 +1130,7 @@ grestore ((eq? head 'rotate-stencil) (interpret (caddr expr))) ((eq? head 'translate-stencil) (interpret (caddr expr))) ((eq? head 'combine-stencil) - (for-each (lambda (e) (interpret e)) (cdr expr))) + (for-each interpret (cdr expr))) (else (collect (fold-false-pairs (strip-floats expr)))) -- 2.39.2