From: Andy Wingo <wingo@pobox.com>
To: Marek Kubica <marek@xivilization.net>
Cc: guile-user@gnu.org
Subject: Re: Modules
Date: Sat, 29 Jan 2011 18:04:14 +0100 [thread overview]
Message-ID: <m3lj234p69.fsf@unquote.localdomain> (raw)
In-Reply-To: <20110129131315.506f1e8c@halmanfloyd> (Marek Kubica's message of "Sat, 29 Jan 2011 13:13:15 +0100")
Hi Marek,
On Sat 29 Jan 2011 13:13, Marek Kubica <marek@xivilization.net> writes:
> On Fri, 28 Jan 2011 17:26:07 +0100
> Andy Wingo <wingo@pobox.com> wrote:
>
>> We don't add the current directory to the search path because it is a
>> security issue, for the same reason that "." is not in $PATH.
>
> What about "the same directory that the file is in"? The point is, when
> writing scripts that become larger than one file, splitting them into
> modules becomes immensely painful because the modules cannot find each
> other.
For what purpose? If you are using modules, they are already in one
global namespace, the various roots of which are in the %load-path
and/or %load-compiled-path. (resolve-module '(foo bar)) should work
regardless of what file calls it.
Perhaps you are interested in `load', which is problematic regarding
compiled files; for example when loading from a compiled file, how will
`load' know what is the current directory? Note that .go files are
installed to e.g. /usr/lib64/guile, while source is in /usr/share/guile.
My suggestion is to use modules by name, or, equivalently, to use
`load-from-path'. There might be a "proper" solution here, but I
haven't found it yet.
See also the bug at http://savannah.gnu.org/bugs/?30480.
Regards,
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2011-01-29 17:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 11:45 Modules Marek Kubica
2010-12-08 18:11 ` Modules Andreas Rottmann
2010-12-09 1:19 ` Modules Nala Ginrut
2011-01-28 16:26 ` Modules Andy Wingo
2011-01-29 12:13 ` Modules Marek Kubica
2011-01-29 13:08 ` Modules Neil Jerram
2011-01-29 13:18 ` Modules Neil Jerram
2011-01-29 17:04 ` Andy Wingo [this message]
2011-01-29 18:37 ` Modules Marek Kubica
2011-01-29 23:17 ` Modules Neil Jerram
2011-01-30 10:13 ` Modules Thien-Thi Nguyen
2011-01-30 11:42 ` Modules Andy Wingo
2011-02-13 19:05 ` Modules Andy Wingo
2011-01-29 17:07 ` Modules Andy Wingo
2011-01-29 18:40 ` Modules Marek Kubica
2011-01-29 23:35 ` Modules Neil Jerram
2011-02-01 21:43 ` Modules Andy Wingo
2011-02-02 14:43 ` Modules Jon Wilson
-- strict thread matches above, loose matches on Subject: below --
2004-03-21 5:40 modules Ian Zimmerman
2004-03-21 14:47 ` modules Andreas Rottmann
2004-03-22 18:05 ` modules Ian Zimmerman
2004-03-23 16:05 ` modules Robert Uhl
2004-03-21 21:29 ` modules Thien-Thi Nguyen
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=m3lj234p69.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=guile-user@gnu.org \
--cc=marek@xivilization.net \
/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).