[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [frogs] Re: Naming output files
From: |
Valentin Villenave |
Subject: |
Re: [frogs] Re: Naming output files |
Date: |
Mon, 2 Mar 2009 11:11:53 +0100 |
2009/2/26 Marek Klein <address@hidden>:
>
> 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
- Re: [frogs] Re: Naming output files,
Valentin Villenave <=