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: Aaron Hill
Subject: Re: Warning when defining variables on the command line
Date: Tue, 19 Nov 2019 11:18:24 -0800
User-agent: Roundcube Webmail/1.3.8

On 2019-11-19 10:58 am, Matt Wallis wrote:
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.

As you discovered, you do need to explicitly define a new variable to leverage this approach.

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

(define-public foo "bar")
  ...is equivalent to...
(begin (define foo "bar") (export foo))

So, the main difference is the additional call to export, which adds the variable to the list of variables exported from the current module.

I probably should be using define-public, as the docs recommend. But I suspect the use of resolve-module as opposed to use-modules lets one see non-exported variables. Either that, or there is some quirk with guile-user where all variables are implicitly exported.


-- Aaron Hill



reply via email to

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