[Top][All Lists]

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

Re: c#(+6 2)

From: Gianmaria Lari
Subject: Re: c#(+6 2)
Date: Mon, 12 Mar 2018 08:20:45 +0100

On 11 March 2018 at 10:58, David Kastrup <address@hidden> wrote:
Gianmaria Lari <address@hidden> writes:

> Just to understand how does it work the relation between scheme and
> lilypond. Why this does not work?
> \version "2.19.81"
> { c#(+6 2) }
> I would expect this compile to
> \version "2.19.81"
> { c8 }

So much wrong with this... 
First, (+6 2) calls 6 as function on 2.
That doesn't work.  You need (+ 6 2) here.

yes, this was just a typo.
Then Scheme expressions written using # in the middle of music are
expected to be music expressions.
  If you want to insert an actual
duration, you need to write it preceded with $ so that it can have
different type (and trigger different syntactic rules).

But $8 is not a duration.  $(ly:make-duration 3 0) would be a duration.

How does it work ?
Originary I thought that before source compilation, there was a step where to replace scheme expressions with their evaluation, like a preprocessor; that's why I tried c#(+ 6 2). But ok, it's clear it doesn't work in this way.

Is this handled by the lilypond parser that create a parse tree and then according position in the tree and # or $ it expects different types?

Thank you, g.

reply via email to

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