From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: Loading a module from the current-working-directory Date: Thu, 22 Jul 2010 09:52:45 +0200 Message-ID: <87eiewymuq.fsf@ambire.localdomain> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1279785370 15998 80.91.229.12 (22 Jul 2010 07:56:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Jul 2010 07:56:10 +0000 (UTC) Cc: guile-user@gnu.org To: Joel James Adamson Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jul 22 09:56:05 2010 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 1ObqdO-0003rH-R7 for guile-user@m.gmane.org; Thu, 22 Jul 2010 09:56:03 +0200 Original-Received: from localhost ([127.0.0.1]:51261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObqdO-00079Z-9S for guile-user@m.gmane.org; Thu, 22 Jul 2010 03:56:02 -0400 Original-Received: from [140.186.70.92] (port=45127 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Obqd6-00079P-2U for guile-user@gnu.org; Thu, 22 Jul 2010 03:55:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Obqd4-000652-Qs for guile-user@gnu.org; Thu, 22 Jul 2010 03:55:43 -0400 Original-Received: from smtp208.alice.it ([82.57.200.104]:43663) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Obqd4-00064h-IW for guile-user@gnu.org; Thu, 22 Jul 2010 03:55:42 -0400 Original-Received: from ambire.localdomain (95.236.70.47) by smtp208.alice.it (8.5.124.08) id 4C1A2716023E5D89; Thu, 22 Jul 2010 09:55:37 +0200 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1ObqaD-0002Kd-Gv; Thu, 22 Jul 2010 09:52:45 +0200 In-Reply-To: (Joel James Adamson's message of "Wed, 21 Jul 2010 16:27:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Windows 98 (1) 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:7999 Archived-At: () Joel James Adamson () Wed, 21 Jul 2010 16:27:54 -0400 (define-module (popgen popgen)) [...] guile> (set! %load-path (cons (getcwd) %load-path)) guile> (use-modules (popgen popgen)) [...] : no code for module (popgen popgen) ABORT: (misc-error) Where am I going wrong? For module name =E2=80=98(a b c)=E2=80=99, guile constructs relative filena= mes: a/b/c.scm (S: scheme) a/b/c (R: raw) and searches for the file DIR/S and DIR/R for each DIR in =E2=80=98%load-pa= th=E2=80=99 (see variable =E2=80=98%load-extensions=E2=80=99). In this case, (a b ) =E2=89=98 (popgen ) ; module name prefix c =E2=89=98 popgen ; module name leaf The error you see means that none of these files can be found: /home/joel/Documents/ss_theory/scm/popgen/popgen.scm /home/joel/Documents/ss_theory/scm/popgen/popgen /usr/share/guile/site/popgen/popgen.scm /usr/share/guile/site/popgen/popgen /usr/share/guile/1.8/popgen/popgen.scm /usr/share/guile/1.8/popgen/popgen /usr/share/guile/popgen/popgen.scm /usr/share/guile/popgen/popgen Absent a way to associate a module name to a filesystem directory in =E2=80=98%load-path=E2=80=99 in Scheme (e.g., module catalogs in Guile 1= .4.x), a common workaround is to implement an alias in the filesystem: ln -s /home/joel/Documents/ss_theory/scm popgen This approach works here because the module name prefix has length 1. Another way is to avoid having a prefix in the module name, but that's probably not a good idea if the module is intended for installation. Yet another way is to call =E2=80=98primitive-load=E2=80=99 prior to =E2=80= =98use-modules=E2=80=99, but that's somewhat ugly. thi