lilypond-user
[Top][All Lists]
Advanced

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

Re: Warning when defining variables on the command line


From: Matt Wallis
Subject: Re: Warning when defining variables on the command line
Date: Tue, 19 Nov 2019 18:58:18 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 19/11/2019 15:39, Aaron Hill wrote:
On 2019-11-19 3:37 am, Matt Wallis wrote:
I want to pass the subtitle into lilypond on the command line because
it is also required by other programmes (e.g. sox needs the subtitle
to create a tag for the mp3 it creates).
[ . . . ]
But I now get the warning:

    Parsing...WARNING: #f: imported module (guile-user) overrides core
binding `%module-public-interface'

Should I be concerned? Is it safe to ignore? Can I suppress this warning?

With a little more work, you can peek into the guile-user module and grab out what you need without importing the entire module into the current environment:

%%%%
\version "2.19.83"

#(define (guile-user-lookup sym def)
   (let ((mod (resolve-module '(guile-user))))
     (if (module-defined? mod sym) (eval sym mod) def)))

#(format #t "\nHello, ~a!" (guile-user-lookup 'hello "..."))
%%%%

Very interesting! Thank Aaron.

So, I have added the line (in place of your call to format):

    subtitle = #(guile-user-lookup 'subtitle "...")

in order to get back into the world of lilypond variables, and it all works. Without this line I get:

$ lilypond -e '(define subtitle "One Two Three")' SatbScore.ly
GNU LilyPond 2.19.83
Processing `SatbScore.ly'
Parsing...
SatbScore.ly:16:22: error: unknown escaped string: `\subtitle'
\header { subtitle =
                     \subtitle }

A possibly related question ... the lilypond docs use `define-public`, and you use `define`. What is the difference?



reply via email to

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