[EMAIL PROTECTED] (Ludovic Courtès) writes:
> Hi,
>
> Neil Jerram <[EMAIL PROTECTED]> writes:
>
>> It seems to me, though, that this is all a matter of ordering, not of
>> whether the duplicates processing gets invoked. I don't know all the
>> details of the duplicate processing, but by default I would expect a
>> later use-modules (or similar operation) to override an earlier one.
>> Is that what happens?
>
> Roughly, yes. However, the semantics of `module-use!' are very
> different from those of `use-modules' (unlike what one might think ;-)).
> While `use-modules' honors the duplicate binding policies, including
> `replace' as Kevin noted, `module-use!' does no such thing: it blindly
> overrides bindings. A more important concern is that the order of
> `module-use!' invocations matters, which leads to all these strange side
> effects.
>
> `module-use!' is a low-level primitive that really should not be used by
> the "normal user" IMO. Instead, one should rather use
> `module-use-interfaces!' which has the same semantics as `use-modules'.
Absolutely, yes. One day we should get to de-polluting the guile-user
namespace ...
> Getting back to the problem at hand: Since we want to emulate the
> behavior of `use-modules', the safest way would be to use
> `module-use-interfaces!', although we can certainly find (fragile?)
> workarounds.
Yes, except that I think Kevin's patch using process-use-modules is
even better, because it avoids needing the resolve-interface calls,
and also does the call-with-deferred-observers thing, which looks
appropriate here.
Regards,
Neil
_______________________________________________
Guile-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-devel