lilypond-devel
[Top][All Lists]
Advanced

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

Re: Named book file suffixes -- regtest?


From: Carl D. Sorensen
Subject: Re: Named book file suffixes -- regtest?
Date: Fri, 27 Feb 2009 18:05:33 -0700



On 2/27/09 11:53 AM, "Reinhold Kainhofer" <address@hidden> wrote:

> 
>> The code he has shared is the following:
>>> Thank you,
>>> now it works as expected:
>>> 
>>> (define counter-alist '())
>>> 
>>> (define (print-book-with parser book process-procedure)
>>>   (let*
>>>       ((paper (ly:parser-lookup parser '$defaultpaper))
>>>        (layout (ly:parser-lookup parser '$defaultlayout))
>>>        (output-suffix (ly:parser-lookup parser 'output-suffix))
>>>        (output-count (assoc-ref counter-alist output-suffix))
>>>        (base (ly:parser-output-name parser)) )
>>>      
>>>       (if (string? output-suffix)
>>>     (set! base (format "~a-~a" base (string-regexp-substitute
>>>                        "[^a-zA-Z0-9-]" "_" output-suffix))))
>>> 
>>>     ;; must be careful: output-count is under user control.
>>>     (if (not (integer? output-count))
>>>     (set! output-count 0))
>>> 
>>>     (if (> output-count 0)
>>>     (set! base (format #f "~a-~a" base output-count)))
>>>     (set! counter-alist (assoc-set! counter-alist output-suffix (1+
>>> output-count)))
> 
>>> What about set! versus ly:parser-define! ?
> 
> I would rather use ly:parser-define!, if we can find out why it doesn't work.
> It's simply cleaner than using a global variable...
> 
>

Marek,

Can you try again with ly:parser-define!, and try to get some help from
lilypond-devel by describing in more detail how it doesn't work, i.e. what
the errors/error messages are?

Thanks,

Carl





reply via email to

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