One final question before I start working on some package code proposal: All the basic Scheme files are loaded in lily.scm with
(for-each ly:load init-scheme-files) What does this do internally? I.e. how is the visibility handled of definitions/bindings from names in files loaded with ly:load ? When I manually ly:load a .scm file I can see both variables created with define and define-public. I have the impression that everything loaded with ly:load is visible to any .ly file afterwards, is that correct? So my approach would be to create a file packages.scm, add it to the list of auto-loaded files in lily.scm and define in this only what is to become the public interface of the package mechanism. All internal code would be loaded from there with (use-modules), or am I missing something here? Where would I store Scheme modules which are *not* to be loaded through ly:load in lily.scm but through (use-modules)? We *do* have a number of such modules in the scm directory. (git grep "(scm " indicates this for the following modules: * accreg * clip-region * coverage * display-lily * editor * framework-eps * framework-null * framework-ps * framework-scm * framework-svg * graphviz * guile-debugger * lily * ly-syntax-constructors * memory-trace * output-ps * output-socket * output-svg * page * paper-system * ps-to-png * safe-utility-defs * song * song-util * to-xml So I could simply store my guile modules there too, but wouldn't it make sense to move them to a new directory to disentangle ly:load from use-modules files? That would seem in line with moving the .ly files like bagpipe.ly which are not loaded automatically but only upon request to packages. Urs