Walt North <waltno...@gmail.com> writes:

> Thank. well that got me a step farther.  However now I see that this works
> without curly braces around the \markup...Examples below.  I'm not that
> familiar with guile so it's probably related to how variables work in
> guile. The end goal is to have a fair amount of template stuff in the
> function with some variables passed in to fill in some gaps.
> \version "2.24.4"
>
> hdr =
> #(define-scheme-function (name) (string?)
>    #{
>      \header {
>      title = \markup #name
>      }
>    #})
> \hdr "test"
> %\header { title = test }
> \score {
> {c4 d e f}
> }
>
> This throws an error.
> hdr =
> #(define-scheme-function (name) (string?)
>    #{
>      \header {
>      title = \markup {#name}
>      }
>    #})

# starts a Scheme expression.  Identifiers in Scheme are separated by
spaces, parens and quote marks.  So you are asking Scheme to fill in a
variable called name} (including a closing curly brace) and Scheme does
not know such a variable.  Also the closing curly brace you included in
the variable name is then leaving an unmatched opening curly brace in
its wake.

> Guile signaled an error for the expression beginning here
>
> title = \markup {#
>
> name}
>
>
> Unbound variable: #{name\x7d;}#

Which tells you exactly that, just in a contorted manner.

>
> C:/Users/waltn/AppData/Local/Temp/frescobaldi-hg83vfc9/tmpix0jvon3/document.ly:8:7
> <1>: error: syntax error, unexpected end of input
>
> }

And here is what the missing closing brace then caused.

Anyway, even if properly separated with spaces, the curly braces are
spurious.  What do you hope to achieve with them?

-- 
David Kastrup

Reply via email to