lilypond-devel
[Top][All Lists]
Advanced

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

Re: ly:make-music-function issue (bug?)


From: Erik Sandberg
Subject: Re: ly:make-music-function issue (bug?)
Date: Sun, 26 Mar 2006 20:12:44 +0100
User-agent: KMail/1.8.3

On Sunday 26 March 2006 18.54, Daniel Schmolze wrote:
> I've written a function that accepts three arguments and returns a function
> that accepts some music. The function looks like this (for the purposes of
> this post):
>
> #(define (foo a b c) (lambda (m) m))
>
> Now, this works fine:
>
> { \applyMusic #(foo 1 2 3) {a' b' c''} }
>
> However, I'd like to be able to do the following:
>
> { \foo #1 #2 #3 {a' b' c''} }
>
> So I tried this:
>
> blah = #(ly:make-music-function
>       (list number? number? number? ly:music?)
>       (lambda (parser location a b c music)
>         ((foo a b c) music)))
>
> { \blah #1 #2 #3 {a' b' c''} }
>
> Which gives me "error: can't find signature for music function".
>
> Now here's the odd part. If I change the function to accept less than three
> arguments, everything works as expected:

It has to do with the way function calls are handled by the parser. Currently, 
there is a short list of hard-coded signatures which are allowed; grep 
parser.yy for FUNCTION to see which ones. It's a rather dirty solution, which 
is waiting for a cleanup.

-- 
Erik




reply via email to

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