From: Marius Vollmer <mvo@zagadka.de>
Subject: Re: [PATCH] Augmenting the doc of `define-module'
Date: Wed, 07 Dec 2005 02:31:06 +0200 [thread overview]
Message-ID: <87mzjd3fzp.fsf@zagadka.de> (raw)
In-Reply-To: <87wtj7yz1b.fsf@laas.fr> (Ludovic Courtès's message of "Thu, 17 Nov 2005 18:17:20 +0100")
ludovic.courtes@laas.fr (Ludovic Courtès) writes:
> Any news regarding this patch?
I made the following changes. OK?
Index: api-modules.texi
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/doc/ref/api-modules.texi,v
retrieving revision 1.11
diff -u -r1.11 api-modules.texi
--- api-modules.texi 5 Nov 2005 21:38:49 -0000 1.11
+++ api-modules.texi 7 Dec 2005 00:28:42 -0000
@@ -456,17 +456,32 @@
is not also ``replacing''. Normally a replacement results in an
``override'' warning message, @code{#:replace} avoids that.
-This can be used by a module extending a core function in an upwardly
-compatible way, like SRFI-39 @code{current-input-port}
-(@pxref{SRFI-39}).
+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.
-Or it can be used by a module which is intentionally producing a new
-special kind of environment and should override any core or other
-bindings already in scope. For example perhaps a logic processing
-environment where @code{<=} is an inference instead of a comparison.
+For instance, SRFI-39 exports a binding named
+@code{current-input-port} (@pxref{SRFI-39}) that is a function which
+is upwardly compatible with the core @code{current-input-port}
+function. Therefore, SRFI-39 exports its version with
+@code{#:replace}.
-@code{#:duplicates} below provides fine-grain control about duplicate
-binding handling on the module-user side.
+SRFI-19, on the other hand, exports its own version of
+@code{current-time} (@pxref{SRFI-19 Time}) which is not compatible
+with the core @code{current-time} function (@pxref{Time}). Therefore,
+SRFI-19 does not use @code{#:replace}.
+
+The @code{#:replace} option can also be used by a module which is
+intentionally producing a new special kind of environment and should
+override any core or other bindings already in scope. For example
+perhaps a logic processing environment where @code{<=} is an inference
+instead of a comparison.
+
+The @code{#:duplicates} (see below) provides fine-grain control about
+duplicate binding handling on the module-user side.
@item #:duplicates @var{list}
@cindex duplicate binding handlers
--
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
next prev parent reply other threads:[~2005-12-07 0:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-21 12:59 [PATCH] Augmenting the doc of `define-module' Ludovic Courtès
2005-10-23 21:15 ` Kevin Ryde
2005-10-24 8:21 ` Ludovic Courtès
2005-10-24 21:29 ` Kevin Ryde
2005-10-25 7:34 ` Ludovic Courtès
2005-11-05 21:41 ` Kevin Ryde
2005-11-07 10:18 ` Ludovic Courtès
2005-11-17 17:17 ` Ludovic Courtès
2005-12-05 12:07 ` Ludovic Courtès
2005-12-07 0:31 ` Marius Vollmer [this message]
2005-12-07 8:12 ` Ludovic Courtès
2006-02-21 8:42 ` Use of `:replace' in some SRFI modules 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=87mzjd3fzp.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).