lilypond-devel
[Top][All Lists]
Advanced

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

Re: parser variables persist beyond { } scope


From: Patrick McCarty
Subject: Re: parser variables persist beyond { } scope
Date: Fri, 31 Jul 2009 14:59:22 -0700

On Fri, Jul 31, 2009 at 2:44 PM, Trevor Daniels<address@hidden> wrote:
>
> Mark Polesky wrote Friday, July 31, 2009 8:51 PM
>>
>> I'm okay with it. But I'd like to see what the others think. Am
>> I correct in thinking that if an object returns #t for this test
>> from within a .ly file, it qualifies as a "parser variable"?
>>
>> #(defined? 'object-name)
>
> Sorry, I don't know.  Anyone else?

I *think* that's true.

For example, in a \paper block, you could do:

  \paper {
    annotate-spacing = ##t
    #(display (defined? 'annotate-spacing))
  }

or

  \paper {
    #(define annotate-spacing #t)
    #(display (defined? 'annotate-spacing))
  }

Both display true.  But this will display false:

  \paper {
    #(display (defined? 'annotate-spacing))
  }

The same should be true for variable assignments outside of \paper,
\layout, and \header too.  I recently read about this in the Guile
manual:

http://www.gnu.org/software/guile/manual/html_node/Binding-Constructs.html#Binding-Constructs


HTH,
Patrick




reply via email to

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