lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme void function problems


From: David Nalesnik
Subject: Re: Scheme void function problems
Date: Wed, 25 Mar 2015 10:33:51 -0500

Hi Simon,

I can't judge whether this is getting closer to you want, but maybe my observations can help.

On Wed, Mar 25, 2015 at 9:17 AM, Simon Albrecht <address@hidden> wrote:
Hello,

I’m experimenting with an implementation of automatic tagline language selection and currently have two problems with the void function \language that I adapted from music-functions-init.ly:
– I can’t get the first, optional argument to work; it needs to be explicitly given or Lily will take the string as first argument – although it’s required to be a symbol.

I haven't succeeded in making this work with the optional argument in the first position.  I moved it last.   However, the last argument either must be specified with a symbol or with \default.  Otherwise, the following _expression_ will be taken as the argument and an error will be raised: in my rewrite that is '#(newline)'. 

– The define in the second clause to cond doesn’t work: there are two errors due to output-language being an unbound variable.

You need to define output-language as a global variable.  Then you can set it within the music function.  In your version, output-language only exists within the music function's scope, and so it is inaccessible to your format call, for example.

Note:
I don't think the cond _expression_ within the definition of 'language' is what you want.  Once we hit a true value, we leave the cond _expression_ entirely.  It appears that you want _both_ clauses to be evaluated, so I used two if expressions. 
 
Hope this helps,
David


Attachment: tagline-c.ly
Description: Text Data


reply via email to

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