Hi,

Kevin Ryde <[EMAIL PROTECTED]> 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).

Thanks,
Ludovic.


_______________________________________________
Guile-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to