From: ludo@gnu.org (Ludovic Courtès)
To: 17418@debbugs.gnu.org
Subject: bug#17418: #:select gives access to private variables
Date: Tue, 06 May 2014 10:48:17 +0200 [thread overview]
Message-ID: <87sion47ji.fsf@gnu.org> (raw)
Consider this module:
--8<---------------cut here---------------start------------->8---
(define-module (t))
(define private #t)
--8<---------------cut here---------------end--------------->8---
And now:
--8<---------------cut here---------------start------------->8---
[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=0
;;; 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/guix/t.scm.go
scheme@(guile-user)> private
;;; <unknown-location>: warning: possibly unbound variable `private'
ERROR: In procedure #<procedure 1e532a0 ()>:
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]>
--8<---------------cut here---------------end--------------->8---
This is as expected.
But adding #:select (private) gives access to ‘private’:
--8<---------------cut here---------------end--------------->8---
[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 = #t
--8<---------------cut here---------------end--------------->8---
Ludo’.
next reply other threads:[~2014-05-06 8:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 8:48 Ludovic Courtès [this message]
2014-06-02 1:06 ` bug#17418: #:select gives access to private variables Mark H Weaver
2014-06-02 8:08 ` Ludovic Courtès
2014-06-03 23:08 ` Mark H Weaver
2014-06-03 23:11 ` Mark H Weaver
2016-06-21 14:03 ` Andy Wingo
2016-06-21 14:52 ` Ludovic Courtès
2016-06-21 15:17 ` Andy Wingo
2016-06-21 16: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=87sion47ji.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=17418@debbugs.gnu.org \
/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).