lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Load .scm file from within define-void-function


From: Urs Liska
Subject: Load .scm file from within define-void-function
Date: Mon, 02 Mar 2015 10:32:51 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

I have written a function that abstracts the loading of include files (by performing different path checks, offering a dot-notation interface and ensuring that files are included only once). The actual loading is done through ly:parser-include-string using an "\include" statement.

Now I'd like to extend the function to be able to load either LilyPond or Scheme files. (It will be passed the name without extension, and depending on what file type exists on disk it would do the right thing.

However, AFAICS I can only use (use-modules) as a top-level expression and not within a Scheme function. OTOH I can't use the "\include" approach either because then the file would be interpreted as LilyPond - which of course fails.

So: Is it possible to load a Scheme module from within a (define-void-function) ?

Any hint or solution would be greatly appreciated.
Urs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]