[frogs] Re: T1055: Avoid using deprecated %module-public-interface in guile initialisation. (issue1160044)

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Patrick,

On 27/07/10 00:05, Patrick McCarty wrote:
> 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.

I've tested with V1.8 and it's fine.  I've merged it into the patch for
Tracker-1055 which I am just regression-testing at the moment. Keep your
fingers crossed - it looks like it's got past the clip-regions test
which was failing before.  Looks like the ly_use_module line was the
problem.  Thanks, nice catch.

Cheers,
Ian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMUFOTAAoJEBqidDirZqASPpUIANCek8vKApQxeNw1PIxYNc55
eOy6+lDR/qH7DBY/+kBUQdEIMR8sJfgrDe2oIoBvyxFGDg4qLSNLukbJuSovZQkh
Gqd+o5a0J8r6kZ4WoXwRLOo4dHahG6QSdaq0Zo5lTBK3eKYLLC5Um/x/V551QohX
58udpzYhVnDEFtEjV1ok11qTO3XjMnsO+UAp8PZFwSdJfeFn6S5Ot0z64UeeR33U
uhECR3MjiS4gdOGjyNoBBtfNYC8JfxwuuISAwdLFFpeLVTe+W3PMUH3mFNb4DOjg
ttVsHmq118gPgrCNZt1wVVDJ/75SsEdeaEGmNndMPmND++7BQI5N6/3c2gtvF8w=
=L1g0
-----END PGP SIGNATURE-----

---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/