[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
recursive music function definitions broken in 2.14 ?
From: |
Juha Erkkila |
Subject: |
recursive music function definitions broken in 2.14 ? |
Date: |
Mon, 3 Oct 2011 14:57:39 +0300 |
User-agent: |
Mutt/1.4.2.3i |
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
}
}
----------------------------------------------------------------------
The point here is that both \foo and \bar should give equivalent
results when used with \keepWithTag. The function \tags takes
a list of tags and applies them to a music expression.
With 2.12 this used to work (I don't have one to test here with,
but I'm quite sure), but with 2.14.2 I get this:
----------------------------------------------------------------------
GNU LilyPond 2.14.2
Processing `foo.ly'
Parsing...
<string>:1:39: error: syntax error, unexpected MARKUPLINES_IDENTIFIER
parseStringResult = \notemode { \tags
\lilyvartmpbg \tag \lilyvartmpbh
\lilyvartmpbi }foo.ly:12:2: error: errors found, ignoring music expression
{
foo.ly:0: warning: no \version statement found, please add
\version "2.14.2"
for future compatibility
success: Compilation successfully completed
----------------------------------------------------------------------
I don't know if this style was okay to begin with, but I guess
I was lucky that it worked.
Perhaps some definition in straight scheme might also work here?
Any ideas?
Juha
- recursive music function definitions broken in 2.14 ?,
Juha Erkkila <=