lilypond-devel
[Top][All Lists]
Advanced

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

Re: Scoping of Guile modules


From: Han-Wen Nienhuys
Subject: Re: Scoping of Guile modules
Date: Sat, 6 Feb 2021 21:01:48 +0100

On Sat, Feb 6, 2021 at 7:21 PM Jonas Hahnfeld <hahnjo@hahnjo.de> wrote:

> While trying to understand the current situation of LilyPond and its
> Guile modules, I noticed that there is a certain split:
>  * lily.scm and all files pulled in by ly:load are referenced relative
> to scm/, ie just the file name (without the extension after my changes
> at https://gitlab.com/lilypond/lilypond/-/merge_requests/635 ).
>  * On the other hand, proper modules are prefixed with (scm), for
> example (scm framework-ps) and (scm output-ps).
>
> This works right now, but requires that main_with_guile prepends both
> the determined datadir and datadir + "/scm" to the %load-path. Similar
> treatment would be necessary for %load-compiled-path for the compiled
> bytecode. That's a bit ugly because it requires an scm/ directory to
> hold the compiled .go files...
>
> I experimented with this locally and it seems possible to remove the
> (scm) scope and reference all modules relative to scm/, ie have modules
> (framework-ps), (output-ps) and so on. My question would be: Is there a
> good reason *not* to do this?
> As far as I could find out, this split goes back to the very first
> module added in commit
>
> https://gitlab.com/lilypond/lilypond/-/commit/e11dc9a89c31b64615bcdcb8b536621ded30176b
> from 2001. I'm adding Han-Wen and Jan, do you happen to remember if
> that was an explicit choice or "just worked"?
>

I think this is a setup that stuck to the wall when we threw it, so there
is no urgent reason to keep the naming precisely like this. However, other
Scheme modules are grouped (eg, "(srfi srfi-1)" or "(ice-9 optargs)"). I
think it would be good to follow this style and have a lilypond-specific
prefix. Maybe "(lily framework-ps)" ?

Are you trying to create a setup where the byte-compiled files are
preinstalled?

-- 
Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen


reply via email to

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