|
From: | Aaron Hill |
Subject: | Re: Bug with transpose in functions |
Date: | Fri, 12 Jul 2019 00:09:16 -0700 |
User-agent: | Roundcube Webmail/1.3.8 |
On 2019-07-11 11:52 pm, Immanuel Litzroth wrote:
This seems to do the wrong thing:\version "2.19.81" testme = #(define-music-function (parser location music) (ly:music?) #{ \transpose c c' {#music } {#music } #}) \testme g'printing out two g'' instead of a g'' and a g'
Consider using $music or ly:music-deep-copy: %%%% \version "2.19.83" testI = #(define-music-function (music) (ly:music?) #{ \transpose c c' $music $music #}) testII = #(define-music-function (music) (ly:music?) #{ \transpose c c' #(ly:music-deep-copy music) #music #}) \testI d' \testII e' %%%%
Also I found it strange that {#music} is not accepted as an argument withthe following error:tmp.ly:6:16: error: GUILE signaled an error for the expression beginninghere{# music} Unbound variable: music}It seems to parse the closing } as part of the variable name.
Scheme is pretty permissive with what can be part of a symbol, so this is one case where whitespace does matter.
-- Aaron Hill
[Prev in Thread] | Current Thread | [Next in Thread] |