[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modules

From: Andy Wingo
Subject: Re: Modules
Date: Sat, 29 Jan 2011 18:04:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Marek,

On Sat 29 Jan 2011 13:13, Marek Kubica <address@hidden> writes:

> On Fri, 28 Jan 2011 17:26:07 +0100
> Andy Wingo <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]