From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#17418: #:select gives access to private variables Date: Sun, 01 Jun 2014 21:06:49 -0400 Message-ID: <8738fo2k7q.fsf@yeeloong.lan> References: <87sion47ji.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1401671306 2879 80.91.229.3 (2 Jun 2014 01:08:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Jun 2014 01:08:26 +0000 (UTC) Cc: 17418@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jun 02 03:08:19 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WrGja-0004rQ-HN for guile-bugs@m.gmane.org; Mon, 02 Jun 2014 03:08:18 +0200 Original-Received: from localhost ([::1]:42520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrGja-0005C6-1Q for guile-bugs@m.gmane.org; Sun, 01 Jun 2014 21:08:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrGjQ-0005Az-N9 for bug-guile@gnu.org; Sun, 01 Jun 2014 21:08:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrGjK-0005QG-NQ for bug-guile@gnu.org; Sun, 01 Jun 2014 21:08:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrGjK-0005QA-KI for bug-guile@gnu.org; Sun, 01 Jun 2014 21:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WrGjJ-0002BZ-S2 for bug-guile@gnu.org; Sun, 01 Jun 2014 21:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 02 Jun 2014 01:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17418 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 17418-submit@debbugs.gnu.org id=B17418.14016712358324 (code B ref 17418); Mon, 02 Jun 2014 01:08:01 +0000 Original-Received: (at 17418) by debbugs.gnu.org; 2 Jun 2014 01:07:15 +0000 Original-Received: from localhost ([127.0.0.1]:40149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrGiX-0002AB-Uv for submit@debbugs.gnu.org; Sun, 01 Jun 2014 21:07:14 -0400 Original-Received: from world.peace.net ([96.39.62.75]:59850 ident=hope0) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrGiO-00029n-4X for 17418@debbugs.gnu.org; Sun, 01 Jun 2014 21:07:11 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1WrGiG-0003ea-Tv; Sun, 01 Jun 2014 21:06:57 -0400 In-Reply-To: <87sion47ji.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 06 May 2014 10:48:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7476 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Consider this module: > > (define-module (t)) > > (define private #t) > > And now: > > [ludo@pluto:~/src/guix]$ guile -L . > GNU Guile 2.0.11.20-4338f > Copyright (C) 1995-2014 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guile-user)> (use-modules (t)) > ;;; note: source file ./t.scm > ;;; newer than compiled /home/ludo/.cache/guile/ccache/2.0-LE-8-2.0= /home/ludo/src/guix/t.scm.go > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling ./t.scm > ;;; compiled /home/ludo/.cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/gu= ix/t.scm.go > scheme@(guile-user)> private > ;;; : warning: possibly unbound variable `private' > ERROR: In procedure #: > ERROR: In procedure module-lookup: Unbound variable: private > > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. > scheme@(guile-user) [1]>=20 > > This is as expected. > But adding #:select (private) gives access to =E2=80=98private=E2=80=99: > > [ludo@pluto:~/src/guix]$ guile -L . > GNU Guile 2.0.11.20-4338f > Copyright (C) 1995-2014 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guile-user)> (use-modules ((t) #:select (private))) > scheme@(guile-user)> private > $1 =3D #t I agree that this is arguably a bug, but there exists code that depends on this behavior. One example is system/repl/coop-server.scm, which needs access to some private bindings from system/repl/server.scm and system/repl/repl.scm. I confess that I even suggested it, because the alternatives were unpleasant. Perhaps we should consider making #:select issue a warning when it imports private bindings, and also adding a mechanism to import private bindings without a warning. What do you think? Mark