|
From: | Jean Abou Samra |
Subject: | Re: Scheme expressions on lilypond command line (-e) |
Date: | Mon, 19 Oct 2020 23:45:57 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hi all,
I am trying to define a variable on the command line that I can use within the .ly file. I've tried both
and-e "(define-public part 1)"
-e "(define part 1)"
In the .ly file, I have a Scheme _expression_
#(if (= part 0)
(define partName "")
(define partName (string-append "S" part))
)
In either case, I get the error
GUILE signaled an error for the _expression_ beginning here
#
(if (= part 0)
Unbound variable: part
I guess I'm either defining the variable incorrectly, or dereferencing it incorrectly within the script. Can someone help?
Thanks,
Dave
Have a look at
lilypond.org/doc/v2.21/Documentation/usage/command_002dline-usage#basic-command-line-options-for-lilypond.html
You need
#(use-modules (guile-user)) at the top of your LilyPond source. You can ignore the warning that shows up (https://gitlab.com/lilypond/lilypond/-/issues/3613). Best, Jean
[Prev in Thread] | Current Thread | [Next in Thread] |