lilypond-user
[Top][All Lists]
Advanced

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

Re: recursive music function definitions broken in 2.14 ?


From: David Nalesnik
Subject: Re: recursive music function definitions broken in 2.14 ?
Date: Mon, 3 Oct 2011 07:32:35 -0500

Hi Juha,

On Mon, Oct 3, 2011 at 6:57 AM, Juha Erkkila <address@hidden> wrote:
Howdy,

I had some lilypond code that worked in 2.12 versions, but appears
broken in 2.14.  I had used a construction in which a music function
calls itself.  Here's an example:

----------------------------------------------------------------------
tags = #(define-music-function (parser location tags music)
                              (list? ly:music?)
        (cond ((null? tags) music)
              (else (let ((firsttag  (car tags))
                          (othertags (cdr tags)))
                     #{ \tags $othertags \tag $firsttag $music #}))))

foo = \tag #'a \tag #'b { c4 d e f }
bar = \tags #'(a b) { c4 d e f }

\score {
 {
   \keepWithTag #'a \foo
   \keepWithTag #'b \foo

   \keepWithTag #'a \bar
   \keepWithTag #'b \bar
 }
}
----------------------------------------------------------------------


Perhaps some definition in straight scheme might also work here?
Any ideas?


I removed the $ from firsttag and othertags, and it seems to work in 2.14.2.

 tags = #(define-music-function (parser location tags music)
                              (list? ly:music?)
        (cond ((null? tags) music)
              (else (let ((firsttag  (car tags))
                          (othertags (cdr tags)))
                     #{ \tags othertags \tag firsttag $music #}))))

reply via email to

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