On Wed, Mar 25, 2015 at 11:13 AM, David Nalesnik <david.nales...@gmail.com> wrote:
> Hi again, > > On Wed, Mar 25, 2015 at 10:33 AM, David Nalesnik <david.nales...@gmail.com > > wrote: > >> 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 <simon.albre...@mail.de> >> 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)'. >> >> > How about this? I'm viewing the first argument as a slot for either a > symbol ('general and the like) or a string (the language name). The last > argument is optional. I used the scheme? predicate to solve the lookahead > problem. Anything will be taken, and it's up to the function to reject > anything that's not a string. (Presumably, it's unlikely that you'd follow > the music function with a string, but who knows...) > Oh, drat. That means that if you have \language "deutsch" { c } The music expression is thrown away... You would need to save the value of the last argument if not a string. This is getting too hairy. Unless someone has a better idea, my final answer is my first post... David
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user