lilypond-user
[Top][All Lists]
Advanced

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

Re: parser location inTab


From: Aaron Hill
Subject: Re: parser location inTab
Date: Sat, 26 Jan 2019 00:31:37 -0800
User-agent: Roundcube Webmail/1.3.8

On 2019-01-25 7:22 pm, Gack McShite wrote:
Trying to clean up errors.  I see this pattern a lot, so I assume it
should work.

TrackAVoiceAMusic = #(define-music-function (parser location inTab) (boolean?)
#{
   \tempo 4=106
   \clef #(if $inTab "tab" "treble_8")

What stands out to me is the extra $. Since the # already switches context from LilyPond syntax to Scheme, you need only write "inTab" in that case. Otherwise to Scheme, "$inTab" is a different symbol than "inTab".

Side note: It is a common convention in Scheme that Boolean variables and functions end in a question mark. Certainly not required, but you might consider using "inTab?".


-- Aaron Hill



reply via email to

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