lilypond-user
[Top][All Lists]
Advanced

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

Re: Defining 'not-last-page'


From: Matthew Collett
Subject: Re: Defining 'not-last-page'
Date: Fri, 15 Jul 2011 23:07:40 +1200

On 15/07/2011, at 4:28 pm, Nick Payne wrote:

> On 15/07/11 10:20, Matthew Collett wrote:
>> #(define (not-last-page layout props arg)
>>   (if (not (book-last-page? layout props))
>>       (interpret-markup layout props arg)
>>       empty-stencil))
>> 
>> However, any attempt to _use_ this results in 'ERROR: Unbound variable: 
>> book-last-page?'.  
> 
> This works for me:
> 
> \paper {
>    %% cf. ly/titling-init.ly
>    #(define (not-last-page layout props arg)
>        (if (and (chain-assoc-get 'page:is-bookpart-last-page props #f)
>            (chain-assoc-get 'page:is-last-bookpart props #f))
>            empty-stencil
>            (interpret-markup layout props arg)))
> }

Hmm.  That just unpacks the definition of 'book-last-page?', which is itself in 
titling-init.ly.  If I precede my definition of 'not-last-page' with a copy of 
that definition,

#(define (book-last-page? layout props)
   (and (chain-assoc-get 'page:is-bookpart-last-page props #f)
        (chain-assoc-get 'page:is-last-bookpart props #f)))

all is well.  

I still don't understand why I can use 'last-page' (defined in titling-init.ly) 
with no problem, but cannot use 'book-last-page?' (also defined in 
titling-init.ly) unless I redefine it myself.

Best wishes,
Matthew





reply via email to

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