unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludovic.courtes@laas.fr (Ludovic Courtès)
Subject: Re: top-repl priority of guile module
Date: Mon, 04 Dec 2006 13:15:27 +0100	[thread overview]
Message-ID: <87ejrfhn6o.fsf@laas.fr> (raw)
In-Reply-To: <87ejrj2s79.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 02 Dec 2006 08:59:22 +1100")

Hi,

Kevin Ryde <user42@zip.com.au> 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
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2006-12-04 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 21:59 top-repl priority of guile module Kevin Ryde
2006-12-04 12:15 ` Ludovic Courtès [this message]
2006-12-05  0:26   ` Kevin Ryde
2006-12-05  3:15     ` Kevin Ryde
2006-12-05  9:53       ` Ludovic Courtès
2006-12-08 21:23         ` Kevin Ryde
2006-12-08 21:31           ` Kevin Ryde
2006-12-14 20:05             ` Neil Jerram
2006-12-14 22:53               ` Kevin Ryde
2006-12-30 23:34                 ` Neil Jerram
2006-12-15  8:32               ` Ludovic Courtès
2006-12-30 23:37                 ` Neil Jerram
2007-01-01 22:44                   ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ejrfhn6o.fsf@laas.fr \
    --to=ludovic.courtes@laas.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).