On 2/28/09 5:37 PM, "Marek Klein" <ma...@gregoriana.sk> wrote:
> > My current solution is: > (set! counter-alist (assoc-set! counter-alist output-suffix (1+ > output-count))) > > Reinhold said, it would be better to use ly:parser-define! instead of set! > But I don't understand how... NR says: > Function: ly:parser-define! parser-smob symbol val > > Bind symbol to val in parser-smobĀ¹s module. > It's not clear enough for me... if I try for example: > (ly:parser-define! parser counter-alist (assoc-set! counter-alist > output-suffix (1+ output-count))) > I get following error: > > Parsing.../home/marek/lilypond/usr/share/lilypond/current/scm/lily-library.scm > :152:5: In procedure ly:parser-define! in expression (ly:parser-define! parser > counter-alist ...): > /home/marek/lilypond/usr/share/lilypond/current/scm/lily-library.scm:152:5: > Wrong type argument in position 2 (expecting symbol): () 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 try (ly:parser-define! parser 'counter-alist (assoc-set! counter-alist output-suffix (1+ output-count))) This puts the symbol as the argument, rather than the value of the symbol, I think. Carl _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel