2009/2/26 Reinhold Kainhofer
<address@hidden>
It would actually be quite simple to implement: In scm/lily-library.scm in the
print- book-with function, instead of storing the file count as a number in
'output-count, store it in an alist (which is set as the 'output-count parser
variable), with the suffix as key. This way, the counting is per suffix and
we'll automatically not append the number for the first file with a given
suffix...
I think this would be quite a nice task or a frog, so I'm not coding it
myself, just giving a few pointers... The way to work with the alist (that's
Scheme's idea of a Hash) can be seen e.g. in my counter snippet on LSR:
http://lsr.dsi.unimi.it/LSR/Item?id=543
All you need to do is to use assoc-ref instead of count and ly:parser-define!
(instead of the set! in the counter example) with assoc-set! to set one entry
of the hash / alist. The key for the alist would be the suffix. The rest of
the function doesn't even need to be changed...
Here is my solution: