On 2/27/09 11:53 AM, "Reinhold Kainhofer" <reinh...@kainhofer.com> 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
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel