1 Mar 2009 22:44
Re: Named book file suffixes -- regtest?
Marek Klein <marek <at> gregoriana.sk>
2009-03-01 21:44:43 GMT
2009-03-01 21:44:43 GMT
2009/3/1 Carl D. Sorensen <c_sorensen <at> byu.edu>
I think this error message says that it's expecting a symbol, and instead it
gets an empty list, which is the value of counter-alist right now.
So I think you should tryThis puts the symbol as the argument, rather than the value of the symbol, I
(ly:parser-define! parser 'counter-alist (assoc-set! counter-alist
output-suffix (1+ output-count)))
think.
Carl
With your suggestion and one more line of code it works now with ly:parser-define!
(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))
(counter-alist (ly:parser-lookup parser 'counter-alist))
(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)))
(ly:parser-define! parser 'counter-alist (assoc-set! counter-alist output-suffix (1+ output-count)))
(process-procedure book paper layout base)
))
--
Marek Klein
http://gregoriana.sk
_______________________________________________ lilypond-devel mailing list lilypond-devel <at> gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
RSS Feed