unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.de>
Subject: Re: [PATCH] SRFI-34, SRFI-60 and core bindings
Date: Tue, 13 Dec 2005 23:55:04 +0200	[thread overview]
Message-ID: <87u0dcu0g7.fsf@zagadka.de> (raw)
In-Reply-To: <87r78pxln8.fsf@laas.fr> (Ludovic Courtès's message of "Wed, 07 Dec 2005 11:10:51 +0100")

ludovic.courtes@laas.fr (Ludovic Courtès) writes:

> See also:
> http://lists.gnu.org/archive/html/guile-devel/2005-10/msg00101.html .
>
>> If you don't want to warning, you can define your own way of handling
>> duplicates.  See the NEWS file for docs about the options.
>
> Precisely, you said you were ok to apply the following documentation
> yesterday:
>
>   This is useful for modules that export bindings that have the same
>   name as core bindings.  @code{#:replace}, in a sense, lets Guile know
>   that the module @emph{purposefully} replaces a core binding.  It is
>   important to note, however, that this binding replacement is confined
>   to the name space of the module user.  In other words, the value of the
>   core binding in question remains unchanged for other modules.
>
> So, do we agree on what `#:replace' is for?  :-)

My understanding of #:replace goes along these lines: Importing more
than one binding with the same name into a module should be avoided,
and we should make it an error.  But since it was traditonally allowed
by Guile, we merely warn about it.

However, sometimes one of the bindings is a useful replacement for the
other in the sense that it is fully compatible with it.  In that
situation, it is a nice service by the module system to automatically
choose the replacement and not give a warning.  In that scenario,
using a module is not only a way of saying what set of names you want
to use, but also a way of saying what level of functionality one wants
to have for a name that might also be available without using that
module.  You can use #:replace to mark those bindings that are useful
replacements in this sense to get rid of the useless warning.

When using #:replace, the exporting module is making the promise that
the warning can be surpressed because everything is alright.  It can
only do that if the replacing binding is compatible with what it
replaces.

Often, the user of a module also knows that everything is alright and
wants to surpress the warning.  (That's where you come in,
Ludovic. :-) The user can only do that by giving parameters to
use-modules or its own define-module.  He should not go and add a
#:replace to the exporting module.  The only ways to do avoid the
duplicate warning for a module user currently are to rename the
bindings on import, or to use an explicit #:duplicates handler.
(Right?  Anything else?)

> As a matter of fact, this facility had remained undocumented for years
> and its original author is no longer here (I think) to explain the
> rationale behind it.

Hmm, I think current usage is in line with what I described above.
Right?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2005-12-13 21:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20 13:09 [PATCH] SRFI-34, SRFI-60 and core bindings Ludovic Courtès
2005-10-20 19:42 ` Kevin Ryde
2005-10-21  7:52   ` Ludovic Courtès
2005-10-21 20:36     ` Kevin Ryde
2005-10-24  8:10       ` Ludovic Courtès
2005-12-06 23:23 ` Marius Vollmer
2005-12-07 10:10   ` Ludovic Courtès
2005-12-13 21:55     ` Marius Vollmer [this message]
2005-12-14 10:13       ` Ludovic Courtès
2005-12-28 20:14         ` Neil Jerram
2006-01-03 10:06           ` Ludovic Courtès

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=87u0dcu0g7.fsf@zagadka.de \
    --to=mvo@zagadka.de \
    /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).