Problem with "-e" (execute Scheme code) option

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with "-e" (execute Scheme code) option

Alan Stern
The "-e" command line option (execute Scheme code) doesn't work right.
The code gets executed twice(!) and the results aren't available during
the remainder of the Lilypond run -- which makes the facility useless.

Here's an example with 2.7.33 (behavior under 2.7.37 is the same, but
I can't run the later version on this machine):

$ cat a.ly
\version "2.7.33"

#(display "Value of a: ")
#(display a)
#(newline)
$ lilypond -e '(define a 42) (display "hello") (newline)' a.ly
GNU LilyPond 2.7.33
hello
hello
Processing `a.ly'
Parsing...Value of a: ERROR: Unbound variable: a
Segmentation fault
$




_______________________________________________
bug-lilypond mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: Problem with "-e" (execute Scheme code) option

Han-Wen Nienhuys-2
Alan Stern wrote:
> The "-e" command line option (execute Scheme code) doesn't work right.
> The code gets executed twice(!) and the results aren't available during
> the remainder of the Lilypond run -- which makes the facility useless.
>
> Here's an example with 2.7.33 (behavior under 2.7.37 is the same, but
> I can't run the later version on this machine):

thanks.
I've added the following to the docs


The expression will be evaluated in the @code{guile-user} module, so
if you want to use definitions in @var{expr}, use

@example
lilypond -e '(define-public a 42)'
@end example

@noindent
on the command-line, and include

@example
#(use-modules (guile-user))
@end example

@noindent
at the top of the @code{.ly} file.


--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
  -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
bug-lilypond mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-lilypond