|
From: | Aaron Hill |
Subject: | Re: simple scheme function #{ $note #} |
Date: | Fri, 11 May 2018 08:58:20 -0700 |
User-agent: | Roundcube Webmail/1.3.6 |
On 2018-05-11 08:46, David Kastrup wrote:
Aaron Hill <address@hidden> writes:On 2018-05-11 06:53, Gianmaria Lari wrote:Sorry to bother with a simple question. Why this does not work? \version "2.19.81" pit = #(define-music-function (p) (ly:pitch?) #{ $p #} ) { \pit c' }The result is "error: music function cannot return c'". It appears that a simple pitch by itself is not enough to qualify as music.It's desirable to be able to enter pitches as #{ c' #} and similar. Adda duration to get a music expression.
But can you return an incomplete music expression? It seems like that is the underlying issue why the original code does not work.
If you change the function to "#{ { $p } #}", it compiles.Yes, but the duration is not really well-defined here (happens to end upas the default duration of the current parser).
True, I was not advocating that this is a useful construct, merely showing that it results in a minimally valid expression.
-- Aaron Hill
[Prev in Thread] | Current Thread | [Next in Thread] |