lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating a callback with an additional argument?


From: Wilbert Berendsen
Subject: Re: Creating a callback with an additional argument?
Date: Sun, 26 Sep 2010 20:39:42 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-24-generic; KDE/4.5.0; i686; ; )

Op zondag 26 september 2010 schreef Marc:

> is it possible to create a callback with an additional argument?
> 
> I tried
> 
> #(define-public (my-callback string grob)
> ...
> ..
> )
> 
> and wanted to call it by
> 
> \override Notehead #'stencil = #my-callback #'foo'
> 
> but lilypond complains.

You can make a function that is given the 'foo' argument and returns the 
callback function that expects a grob argument.

like
#(define-public (make-callback string)
...
...(lambda (grob) ...)
)

\override Notehead #'stencil = #(make-callback "foo")

best regards,
Wilbert Berendsen

-- 
Frescobaldi, LilyPond editor for KDE: http://www.frescobaldi.org/
Nederlands LilyPond forum: http://www.lilypondforum.nl/



reply via email to

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