Re: Differentiate between including and direct compiling a file

2021-11-08 Thread Fr. Samuel Springuel
> On Aug 7, 2021, at 3:54 PM, Aaron Hill wrote: > > Perhaps something like this: > > > \version "2.22.0" > > ifCompiledDirectly = > #(define-scheme-function (scm) (scheme?) > (let ((file (car (ly:input-file-line-char-column (*location*) > (if (member file (command-line)) scm))) >

Re: Differentiate between including and direct compiling a file

2021-08-07 Thread Aaron Hill
On 2021-08-07 11:52 am, R. Padraic Springuel wrote: Is there a way for Lilypond to differentiate between a file which is being compiled directly and it being included in the compilation of another file? Something equivalent to `if __name__ == “__main__”` from python? I’d like to add simple exam

Differentiate between including and direct compiling a file

2021-08-07 Thread R. Padraic Springuel
Is there a way for Lilypond to differentiate between a file which is being compiled directly and it being included in the compilation of another file? Something equivalent to `if __name__ == “__main__”` from python? I’d like to add simple examples to my various tools that I can use to test it