Re: [frogs] Re: Naming output files

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


2009/2/26 Marek Klein <marek@xxxxxxxxxxxxx>:
>

> 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! ?

Well done Marek!

Carl, Reinhold, should I open a tracker issue or will this fix get merged soon?

Regards,
Valentin

---

----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/