Am 30.09.2012 11:02, schrieb d...@gnu.org:
[...] First, the define-public is asking for trouble. You are exposing an internal Scheme data structure to users and make it overwritable by the user. If the user follows this invitation, the effects will bleed over from session to session. Never do that.
Ok.
Consider _everything_ written in a .scm file as readonly conceptually. For an alist, you might want to define a _function_ returning the initial list, and the accessors should not be modifying it destructively (adding to the front of an alist does not change the original alist). Then you assign this initial value to a session variable in something included in init.ly, like #(define bar-glyph-alist (initial-bar-glyph-alist))
Ok.
Your functions working with bar-glyph-alist have to take the version of bar-glyph-alist defined in the parser module. That means that when you call them from .ly files, you'll likely need to pass bar-glyph-alist from the .ly file into your Scheme function. Or get them via ly:parser-lookup via the parser variable.
I am not sure whether I understand this completely, but I'll give it a try.
If you put a new bar line definition into a.ly, and when calling lilypond a.ly b.ly it is available in b.ly, then you have done something wrong.
I did this and can confirm that a bar line defined in a.ly *is* available in b.ly. So I have to replace all three public alists in bar-line.scm the way you described it above. [OT: it seems that I have a strong attraction to problems that look not very difficult at first glance and turn out to involve *a lot of* changes and obstacles until they get solved. On the other hand, this is a *perfect* way to learn about the internals of lilypond – in such situations where everything breaks, I remember Jan working on GUB during Waltrop and his statement when the compilation broke again: "That's nice." I admire such a serenity and try to adopt it in situations where I am about to throw the computer out of the window ;-) I am not in this state yet, but I am working on it...] Regards, Marc
http://codereview.appspot.com/6498052/
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel