From: David Kastrup Date: Sat, 24 Nov 2012 22:27:33 +0000 (+0100) Subject: Issue 2978: Simplify calculation of pitch-alist in determine-frets-and-strings X-Git-Tag: release/2.17.8-1~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cdf6e635f84d0f16e855e393364df9ead6c05279;p=lilypond.git Issue 2978: Simplify calculation of pitch-alist in determine-frets-and-strings The old code was contorted and undefined (it used map rather than map-in-order but depended on sequential execution). --- diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 78defd203f..aef6169425 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -396,16 +396,8 @@ the current tuning?" defined-strings defined-fingers)) ;;; body of determine-frets-and-strings - (let* ((pitch-alist (apply (lambda (mylist) - (let ((index -1)) - (map (lambda (note) - (begin - (set! index (1+ index)) - (cons (note-pitch note) - index))) - mylist))) - notes '())) - (pitches (map note-pitch notes))) + (let* ((pitches (map note-pitch notes)) + (pitch-alist (map cons pitches (iota (length pitches))))) ;; handle notes with strings assigned and fingering of 0 (for-each