[frogs] Re: T1055: Avoid using deprecated %module-public-interface in guile initialisation. (issue1160044) |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: Ian Hulin <ian@xxxxxxxxxxxx>
- Subject: [frogs] Re: T1055: Avoid using deprecated %module-public-interface in guile initialisation. (issue1160044)
- From: Patrick McCarty <pnorcks@xxxxxxxxx>
- Date: Mon, 26 Jul 2010 16:05:41 -0700
- Cc: frogs <frogs@xxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=SO660AEylhNdc9e5lJnSvHe0IyzomX0nChCUdoNjxmU=; b=P8CwyhDehffKMhOS1IRhlWhIeZ6xfmcQu9jTC/oaT44yC4IbwuISbnY57BK7GdrhBo 5CFhbMWZNkqBJzaB/IArmz/vEYWeQXzH/Ikhe+JRaBpkhsmG5EWrXo+bkSLpRBIdy52I Q1VVhu4jeMJ2IcATIZq78ANLefqdlVCGaUJgY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=w9Y3rcpLa62l5VQoHsFzJ5RaiPK41RArEatoJ+bNvrEz/MYmNjU5Y2pvtLL37oht/A 3Qwi3yAFl4Ei0thXnZZih0VKVmlt/Q56hfR8Hr/0YtWA3sleiBXiMXjhRk7YEtWFrUp1 cJoYIOnhLrlwbK5MaV7W3Y/f3eyRj28E/oafk=
On Thu, Jul 15, 2010 at 4:30 PM, Ian Hulin <ian@xxxxxxxxxxxx> wrote:
>
> I've been having a look at this, and I need a bit more info, Han-Wenn, on
> why the C++ code uses the %module-public-interface the way it does
>
> SCM mod = SCM_EOL;
> if (!safe)
> {
> SCM maker = ly_lily_module_constant ("make-module");
>
> SCM scm_module = ly_lily_module_constant ("the-scm-module");
>
> mod = scm_call_0 (maker);
> scm_module_define (mod, ly_symbol2scm ("%module-public-interface"),
> mod);
>
> ly_use_module (mod, scm_module);
> ly_use_module (mod, global_lily_module);
> }
> else
> {
> // snip . . .
> }
>
> Which is sort of like doing this in Scheme:
> (define mod (make-module))
> (define curmod '())
> (define scm_module (resolve-module '(the-scm-module)))
> (define global-lily-module '(lily))
> (module-define! mod %module-public-interface mod)
> (set! curmod (set-current-module mod))
> (use-modules (scm-module global-lily-module))
> (set-current-module curmod)
>
> (please excuse the bad Scheme).
>
> Also, ly_use_module does:
> SCM
> ly_use_module (SCM mod, SCM used)
> {
> SCM expr
> = scm_list_3 (ly_symbol2scm ("module-use!"),
> mod,
> scm_list_2 (ly_symbol2scm ("module-public-interface"),
> /* ^no %
> here */
> used));
>
> return scm_eval (expr, global_lily_module);
> }
>
> Han-Wenn, What's the difference between the two ly_symbol2scm calls?
Hi Ian,
I'm glad you noticed that part from ly_use_module(). Whatever the
"module-public-interface" binding (without the %) was used for, it
seems to prevent modules from loading correctly.
Can you test the attached patch (with Guile 1.9) to see if it works
for you? I haven't tested this with Guile 1.8 yet.
Thanks,
Patrick
diff --git a/lily/ly-module.cc b/lily/ly-module.cc
index 42ff2f8..02339be 100644
--- a/lily/ly-module.cc
+++ b/lily/ly-module.cc
@@ -55,10 +55,7 @@ SCM
ly_use_module (SCM mod, SCM used)
{
SCM expr
- = scm_list_3 (ly_symbol2scm ("module-use!"),
- mod,
- scm_list_2 (ly_symbol2scm ("module-public-interface"),
- used));
+ = scm_list_3 (ly_symbol2scm ("module-use!"), mod, used);
return scm_eval (expr, global_lily_module);
}