|
From: | David Nalesnik |
Subject: | Re: Scheme void function problems |
Date: | Wed, 25 Mar 2015 11:19:47 -0500 |
Hi again,On Wed, Mar 25, 2015 at 10:33 AM, David Nalesnik <address@hidden> 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 <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)'.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...)
[Prev in Thread] | Current Thread | [Next in Thread] |