2009/2/28 Carl D. Sorensen <c_soren...@byu.edu>

>
> On 2/27/09 11:53 AM, "Reinhold Kainhofer" <reinh...@kainhofer.com> wrote:
>
> >
> >>> What about set! versus ly:parser-define! ?
> >
> > I would rather use ly:parser-define!, if we can find out why it doesn't
> work.
> > It's simply cleaner than using a global variable...
> >
> >
>
> Marek,
>
> Can you try again with ly:parser-define!, and try to get some help from
> lilypond-devel by describing in more detail how it doesn't work, i.e. what
> the errors/error messages are?
>
> Thanks,
>
> Carl
>
>
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): ()

-- 
Marek Klein
http://gregoriana.sk
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to