lilypond-devel
[Top][All Lists]
Advanced

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

Re: where to put useful lists in the docs?


From: Mark Polesky
Subject: Re: where to put useful lists in the docs?
Date: Mon, 25 May 2009 10:22:57 -0700 (PDT)

Mark Polesky wrote:
> (define grobs-sorted-by-paper-column
>   (let loop ((remaining all-grob-descriptions)
>             (musical '())
>             (non-musical '()))
>     (cond ((null? remaining) (cons musical non-musical))
>           ((ly:assoc-get 'non-musical (cdar remaining))
>                 (loop (cdr remaining)
>                       musical
>                       (append non-musical `(,(caar remaining)))))
>           (else (loop (cdr remaining)
>                       (append musical `(,(caar remaining)))
>                       non-musical)))))
>
> (define-public musical-column-grobs
>   (car grobs-sorted-by-paper-column))
>
> (define-public non-musical-column-grobs
>   (cdr grobs-sorted-by-paper-column))

Incidentally, I found I could simplify these with "filter":

(define musical-column-grobs
  (map car
       (filter (lambda (a) (not (ly:assoc-get 'non-musical (cdr a))))
               all-grob-descriptions)))
                   
(define non-musical-column-grobs
  (map car
       (filter (lambda (a) (ly:assoc-get 'non-musical (cdr a)))
               all-grob-descriptions)))

- Mark



      




reply via email to

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