Hi,

I'm missing a command in LilyPond to include a file only once.
I am working on a general purpose LilyPond library where I am in the situation that many library files have to access common functions and therefore have to include the same file (with these helper functions). Although I assume that it doesn't harm to include a file several times (I think the functions will just be redefined identically) this looks like quite undesired behaviour.

I could figure out a Scheme based solution myself and also found some references to threads on lilypond-user (mainly from 2010). Basically the idea would be to define a variable in that helper file and subsequently only include that file if that variable isn't defined already. But I think that functionality is quite fundamental and should be supported by LilyPond directly.

Therefore I would like to ask for the following feature:

"Implement a command \includeonce that includes a file just like \include, but only once.
Like include_once() in PHP or \RequirePackage in LaTeX."

Best
Urs

_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to