From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] SRFI-34, SRFI-60 and core bindings Date: Tue, 13 Dec 2005 23:55:04 +0200 Message-ID: <87u0dcu0g7.fsf@zagadka.de> References: <87zmp4mj1f.fsf@laas.fr> <871x0p4xpf.fsf@zagadka.de> <87r78pxln8.fsf@laas.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1134511167 8529 80.91.229.2 (13 Dec 2005 21:59:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2005 21:59:27 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Dec 13 22:59:26 2005 Return-path: Original-Received: from [199.232.75.2] (helo=lists.gnu.org) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmIB2-0004Sm-O6 for guile-devel@m.gmane.org; Tue, 13 Dec 2005 22:59:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmIBa-0002NB-Nq for guile-devel@m.gmane.org; Tue, 13 Dec 2005 16:59:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EmIBG-0002Fa-GF for guile-devel@gnu.org; Tue, 13 Dec 2005 16:59:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EmIBD-0002DK-Ml for guile-devel@gnu.org; Tue, 13 Dec 2005 16:59:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmIBC-0002CF-Td for guile-devel@gnu.org; Tue, 13 Dec 2005 16:59:27 -0500 Original-Received: from [213.243.153.36] (helo=smtp3.pp.htv.fi) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EmIDA-0007rJ-1L for guile-devel@gnu.org; Tue, 13 Dec 2005 17:01:28 -0500 Original-Received: from zagadka.ping.de (cs181072157.pp.htv.fi [82.181.72.157]) by smtp3.pp.htv.fi (Postfix) with SMTP id 9E52727AD28 for ; Tue, 13 Dec 2005 23:58:48 +0200 (EET) Original-Received: (qmail 24664 invoked by uid 1000); 13 Dec 2005 23:55:04 +0200 Original-To: guile-devel@gnu.org In-Reply-To: <87r78pxln8.fsf@laas.fr> (Ludovic =?iso-8859-1?Q?Court=E8s's?= message of "Wed, 07 Dec 2005 11:10:51 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org X-Broken-Reverse-DNS: no host name found for IP address 199.232.75.2 Xref: news.gmane.org gmane.lisp.guile.devel:5506 Archived-At: ludovic.courtes@laas.fr (Ludovic Court=E8s) 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 t= he > 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? --=20 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