lilypond-user
[Top][All Lists]
Advanced

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

Re: Macro with


From: David Kastrup
Subject: Re: Macro with
Date: Thu, 14 Nov 2019 15:15:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

David Menéndez Hurtado <address@hidden> writes:

> On Thu, 14 Nov 2019 at 12:47, Aaron Hill <address@hidden> 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

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