David Menéndez Hurtado <davidmen...@gmail.com> writes:

> On Thu, 14 Nov 2019 at 12:47, Aaron Hill <lilyp...@hillvisions.com> wrote:
>
>> Secondly, there's a quirk in variable substitution syntax.  You need to
>> use the $var form, so the parser will see the ly:pitch? and ly:duration?
>> tokens as indicating a single note.
>>
>
> Ah, right. I understand now the manual means with "normal LilyPond input,
> using $ (in places where only Lilypond constructs are allowed) or # (to use
> it as a Scheme value or music function argument or music inside of music
> lists) to reference arguments (eg. ‘#arg1’)." So, every time the input type
> is ly:something, it should be with $, right?

Music is ly:music? .  # passes the content verbatim and requires a
particular type to work since it is evaluated _after_ being fitted into
the syntax parsing.  $ creates a copy of some types (such as music) and
can be treated differently in syntax according to its type but since
some syntax constructs require lookahead (and that in turn requires
knowing the type of the token), the evaluation can happen surprisingly
early.

In general, # works with fewer surprises unless it doesn't work at all.

> Thank you so much, now my source is almost readable, and so much
> quicker!

-- 
David Kastrup

Reply via email to