lilypond-devel
[Top][All Lists]
Advanced

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

Re: music-functions: #$var1 or just $var1 ?


From: Mark Polesky
Subject: Re: music-functions: #$var1 or just $var1 ?
Date: Sun, 25 Apr 2010 10:51:46 -0700 (PDT)

Nicolas Sceaux wrote:
> Inside the #{ ... #} construct, you have to use #$variable
> where a scheme token is required, but you use $variable
> where \variable could be used.  Behind the scenes,
> $variable is actually replaced by something like \tmpvar
> before being parsed.

Can you provide an example of a case where #$ is required
within #{ #} ?  I can't find one.  $ seems to always work.

In fact, I'm probably missing something obvious, but I'm
unable even to find a case where a scheme token (with #) is
actually required in a regular music block.  I've found I
can even do such bizarre things as this:

  voiceCtx = Voice
  noteGrob = NoteHead
  colorSym = #'color
  redVal = #red

  { \override \voiceCtx.\noteGrob \colorSym = \redVal c'' }

and by extension, I can also do this (without using `#$'):

  overrideAlias =
  #(define-music-function
    (parser location ctx grob prop-sym prop-val)
    (scheme? scheme? scheme? scheme?)
    #{
      \override $ctx . $grob $prop-sym = $prop-val
    #})

  { \overrideAlias Voice NoteHead #'color #red c'' }

So, two things:
1) what is a case where omitting the # causes an error?
2) what is the danger of omitting the # otherwise?

Thanks!
- Mark


      




reply via email to

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