From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Re-exporting a replaced binding Date: Sun, 05 Jan 2020 11:03:20 +0100 Message-ID: <87woa6z0d3.fsf@pobox.com> References: <87r20go0j9.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="53485"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Guile Devel To: Ludovic =?utf-8?Q?Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jan 05 11:03:56 2020 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1io2lH-000Dly-2q for guile-devel@m.gmane.org; Sun, 05 Jan 2020 11:03:55 +0100 Original-Received: from localhost ([::1]:40552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io2lF-0002ys-Ts for guile-devel@m.gmane.org; Sun, 05 Jan 2020 05:03:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58878) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io2ky-0002yc-5j for guile-devel@gnu.org; Sun, 05 Jan 2020 05:03:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1io2kx-0002lk-0a for guile-devel@gnu.org; Sun, 05 Jan 2020 05:03:36 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:45891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1io2kv-0002gF-NG; Sun, 05 Jan 2020 05:03:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=DY9EVkM3z8lKcZ3W1trV8fkaZZ04koTDyENKsEq///U=; b=TgchW1auBElbOwMnjkWh64lbERbgjbOgNj2hSnSa+bnJywAsxeKBxBZScKHMTu78S+i1QAjW0bowDKfwDwnBAWfdKlmiRuVw8rDCeOsHa6bLMP49f3FlntfaGMjUD/+6dSIpSK3CwRQXQJc9Mi1ZwV7lcSHcwVqTe373VJ8FBJoOSW58D0fm420w347UNdZO1DVZOIIZ6SuWEyYqtzC+B1fOcVuZg0v2mdjvVVkZMlye8ZoMdDlmWNPnOJO6FK5EWwebk2ioyPSSfT6rpoMU/er78ASZ/SC/0iiFRlt71TsgcjGpDQ2eEnr7Oc9awxIJH79XcOsMTUCZ0/DqDubh7g==; Original-Received: from [88.123.12.110] (helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1io2ks-0004Jf-9y; Sun, 05 Jan 2020 11:03:30 +0100 In-Reply-To: <87r20go0j9.fsf@inria.fr> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22\?\= \=\?utf-8\?Q\?'s\?\= message of "Fri, 03 Jan 2020 19:30:34 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 178.60.130.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20216 Archived-At: On Fri 03 Jan 2020 19:30, Ludovic Court=C3=A8s writes: > I=E2=80=99m not sure if this is an intended consequence of > cf08dbdc189f0005cab6f2ec7b23ed9d150ec43d, so I thought I=E2=80=99d share = this > example of a practical effect: > > ludo@ribbon /tmp [env]$ cat x.scm > (define-module (x) > #:use-module (srfi srfi-1) > #:re-export (delete)) > ludo@ribbon /tmp [env]$ cat y.scm > (define-module (y) > #:use-module (x)) > > (pk 'delete delete) > ludo@ribbon /tmp [env]$ guile -L . -c '(use-modules (y))' > WARNING: (y): imported module (x) overrides core binding `delete' > > ;;; (delete #) > ludo@ribbon /tmp [env]$ guile --version > guile (GNU Guile) 2.9.8 > > Here =E2=80=98delete=E2=80=99 is replaced by srfi-1, but the replaced bit= is not > propagated to module (x), even though (x) simply re-exports it. > > Should the #:re-export clause propagate the replace bit, or should > it not? :-) It is a good question :) Before, if you re-exported a #:replace binding, it wasn't possible to have it be exported without the "replace" bit set. After the change it is possible to do either, and the default changes to not replacing. From NEWS: Note to make this change, we had to change the way replacement flags are stored, to being associated with modules instead of individual variable objects. This means that users who #:re-export an imported binding that was already marked as #:replace by another module will now see warnings, as they need to use #:re-export-and-replace instead. The 3.0 behavior differs from 2.2 in this regard, although it's just warnings and not run-time behavior. I am sympathetic to the concern that it can be difficult to make a system that warns/doesn't warn in the same way on 2.2 vs 3.0 but I think the change is the right thing, as the new behavior is more expressive. Because it's a user-visible change it is in NEWS. LMK if you think we need a change here! Andy