From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Modules Date: Sat, 29 Jan 2011 18:04:14 +0100 Message-ID: References: <20101208124502.5f25b64d@halmanfloyd> <20110129131315.506f1e8c@halmanfloyd> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296320369 28673 80.91.229.12 (29 Jan 2011 16:59:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Jan 2011 16:59:29 +0000 (UTC) Cc: guile-user@gnu.org To: Marek Kubica Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 29 17:59:24 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PjE8y-0005ep-As for guile-user@m.gmane.org; Sat, 29 Jan 2011 17:59:24 +0100 Original-Received: from localhost ([127.0.0.1]:57298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjE8x-0007Bq-Ny for guile-user@m.gmane.org; Sat, 29 Jan 2011 11:59:23 -0500 Original-Received: from [140.186.70.92] (port=52170 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjE8t-0007BN-Ba for guile-user@gnu.org; Sat, 29 Jan 2011 11:59:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjE8r-0004gI-QY for guile-user@gnu.org; Sat, 29 Jan 2011 11:59:19 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:52218 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjE8r-0004g1-K5 for guile-user@gnu.org; Sat, 29 Jan 2011 11:59:17 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 55C113E0E; Sat, 29 Jan 2011 12:00:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=M96IbC6fFd0YbhS/xe+bRZU0Jpc=; b=DjRz9/ J1eRS8swpybv3IeX1ntxy9LKp/qDBqomRTk8nT7NHBoBDwXGnpv8V21+JqcE1zYt uZYAzgIkp22ySxkBx49Thsx9EzFzIaDNAr1AHJ6e02mXR8JXS19XrLQiaTCq3Kar 0bMfWLhyZk/UKT8vnF4Vl2NmukHvOeHdKuXBA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=wCkjUSIRowMU/v0qD6qDzh/0kcDJSk2o D2xmdH0SOaLdw4+nj5+1+m4tNcxCdeQDOJIzcPkSAyokoOtqvq9zpYYltWP4sRsO UjFqrE6WvmonT64Gtq8JEF2tU1dzXqnaHRgrESX6CcDQ5ZALbisF653nxmCou5rl uolX6iUsSxw= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 301203E0D; Sat, 29 Jan 2011 12:00:07 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 798463E0C; Sat, 29 Jan 2011 12:00:05 -0500 (EST) In-Reply-To: <20110129131315.506f1e8c@halmanfloyd> (Marek Kubica's message of "Sat, 29 Jan 2011 13:13:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 395707DC-2BC9-11E0-A3F1-BC4EF3E828EC-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8397 Archived-At: Hi Marek, On Sat 29 Jan 2011 13:13, Marek Kubica writes: > On Fri, 28 Jan 2011 17:26:07 +0100 > Andy Wingo 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/