[Top][All Lists]

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

Re: top-repl priority of guile module

From: Neil Jerram
Subject: Re: top-repl priority of guile module
Date: Sat, 30 Dec 2006 23:37:52 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hi,
> Neil Jerram <address@hidden> 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.


reply via email to

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