lilypond-user
[Top][All Lists]
Advanced

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

Re: Use a variable Scheme module


From: Urs Liska
Subject: Re: Use a variable Scheme module
Date: Mon, 29 Oct 2018 15:24:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1



Am 29.10.2018 um 14:54 schrieb David Kastrup:
Urs Liska <address@hidden> writes:

Is there a way (well, I think I should ask: what's the way) to use
Scheme modules whose names are only available at runtime?

(use-modules (root-level my-module))

where my-module might change. What I actually want to achieve is load
all modules for which .scm files are found in a directory.

Alternatively is there a way to load all submodules of a given module?

https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Using-Guile-Modules.html#Using-Guile-Modules
doesn't seem to indicate any help, but I can't imagine there's no way
to load variable modules at runtime.

Any suggestions?
When all else fails, you can use primitive-eval to execute macro calls
you cobbled together dynamically.


Another approach would be to load the code with (load-from-path). But IISC this *does* parse and provide the function(s) from the loaded file but without the encapsulation provided by modules. So *all* functions and variables defined in that file would be present from the calling file, which isn't desirable.

Urs



reply via email to

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