[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scoping problem in define-music-function
From: |
David Kastrup |
Subject: |
Re: Scoping problem in define-music-function |
Date: |
Mon, 27 Sep 2010 10:51:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Marc Hohl <address@hidden> writes:
> Hello list,
>
> thanks to Reinhold Kainhofer and Wilbert Berendsen I managed to get a
> callback with an
> additional argument.
>
> Now I want to write a music function like this:
>
> myFunction = #(define-music-function parser location fret music)
> (string? ly:music?)
> (let (( ... some expressions ... ))
>
> #{
> \override TabNoteHead #'stencil = #(my-special-callback fret)
> #}
> (..some more scheme stuff working on music...)
> #{
> \revert TabNoteHead #'stencil
> #}
> ))
>
> but lilypond complains with
>
> <string>:2:46: Fehler: GUILE signalisierte einen Fehler für den hier
> beginnenden Ausdruck
> \override TabNoteHead #(quote stencil) = #
> (my-special-callback fret)
> Unbound variable: fret
>
> So fret is not known within #{ ... #}.
>
> Is there a way to define the function in an appropriate way? It
> doesn't matter if the given variable fret is an argument to the music
> function or calculated within the let-block.
Uh, $fret ?
--
David Kastrup