[Top][All Lists]

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

Re: top-repl priority of guile module

From: Ludovic Courtès
Subject: Re: top-repl priority of guile module
Date: Mon, 04 Dec 2006 13:15:27 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)


Kevin Ryde <address@hidden> writes:

> Sven Hartrumpf on guile-user a while ago reported on a run of
>       guile --use-srfi=1
> leaves the REPL with the core `iota', not the srfi-1 one.  What's the
> theory behind this bit of top-repl (in boot-9.scm),
>     ;; so that builtin bindings will be checked first
>     (module-use! guile-user-module (resolve-interface '(ice-9 r5rs)))
>     (module-use! guile-user-module (resolve-interface '(guile)))
> The effect is to override any bindings that srfi modules attempt to
> replace.  So srfi-17 car or srfi-39 current-input-port are similarly
> afflicted.

Wild guess:  Does the following fix the problem:

  (module-use-interfaces! guile-user-module
                          (resolve-interface '(ice-9 r5rs))
                          (resolve-interface '(guile)))

(instead of the two `module-use!' line.)

IIRC, `module-use-interfaces!' calls `process-duplicates', which in turn
correctly honors the `replace' policy for duplicate bindings.

Conversely, `module-use!' just conses the given modules to the module's
use list without invoking `process-duplicates', hence the problem you
are seeing (the interface of `(guile)' ends up before that of
`srfi-XX' in the module use list).


reply via email to

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