From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yanbin Zhang Newsgroups: gmane.lisp.guile.user Subject: Re: Loading a module before and after adding a load path Date: Fri, 18 Jan 2013 11:44:26 -0600 Message-ID: References: <87bocmxzax.fsf@supernova.vialactea> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff25564a2344804d393a9ec X-Trace: ger.gmane.org 1358531077 14243 80.91.229.3 (18 Jan 2013 17:44:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jan 2013 17:44:37 +0000 (UTC) Cc: guile-user@gnu.org To: "Diogo F. S. Ramos" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 18 18:44:56 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TwFzp-0005KF-Tn for guile-user@m.gmane.org; Fri, 18 Jan 2013 18:44:54 +0100 Original-Received: from localhost ([::1]:46315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwFzZ-0005ch-1R for guile-user@m.gmane.org; Fri, 18 Jan 2013 12:44:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwFzS-0005bd-MT for guile-user@gnu.org; Fri, 18 Jan 2013 12:44:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwFzQ-0008MK-3j for guile-user@gnu.org; Fri, 18 Jan 2013 12:44:30 -0500 Original-Received: from mail-da0-f53.google.com ([209.85.210.53]:60327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwFzP-0008MG-T9 for guile-user@gnu.org; Fri, 18 Jan 2013 12:44:28 -0500 Original-Received: by mail-da0-f53.google.com with SMTP id x6so1720590dac.12 for ; Fri, 18 Jan 2013 09:44:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=QGE0aETjzPYfNkTI6CQi2eq1KVp807fhzADc3LZtLOg=; b=hg2d0aCjQugrkr5WkKN3ZnJyiaSl4jMlXPli89wnB/gc/Lg3govpXzI3oWXeRuWCVq Sk24KtBfHAOqWRQCKMDQIFzq67hTHYEdnmgcMNn8QcDzW1gUcxa3mieGk8MKTHKz7BCg dXSqR7AHXfzzOEwVc8PQg+/kOYw6gpRZ7g27Qh8W1+6kOPPY3bwbMoinUNnF1qGk19q3 yWEhtOnbUzdDCbFzIHzcbZrDNRFEsToJL6rVzvRtnTMz7EloITgDZFbK7AstSrUM2Bv8 NYXcwxfuYud2Z1GIGYmu86oQ2NntmkQDG3rXk8M5tuuzemZBQsjnkVAcXvrOCD/vIdHE of5w== X-Received: by 10.68.225.70 with SMTP id ri6mr7490647pbc.41.1358531066475; Fri, 18 Jan 2013 09:44:26 -0800 (PST) Original-Received: by 10.68.34.70 with HTTP; Fri, 18 Jan 2013 09:44:26 -0800 (PST) In-Reply-To: <87bocmxzax.fsf@supernova.vialactea> X-Google-Sender-Auth: EzKEnq5yk8ImKdtQtwpQC6t7qH0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.53 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9881 Archived-At: --e89a8ff25564a2344804d393a9ec Content-Type: text/plain; charset=ISO-8859-1 Hi, I guess you need to tell GUILE where to find your module before you can load it. GUILE has some standard places where it will look for modules. If your module is not there, then you need to add the path so that GUILE can find it. There are several ways to do this. One is to use "add-to-load-path" as you did. Another would be setting up some environment variable so that a certain path is added. You can find more detailed information in the manual. Yanbin On Fri, Jan 18, 2013 at 9:53 AM, Diogo F. S. Ramos wrote: > I have a module at `/path/to/foo'. > > If I open a guile REPL and type: > > (add-to-load-path "/path/to/foo") > (use-modules (foo bar)) > > everything works. But, if I type: > > (use-modules (foo bar)) > (add-to-load-path "/path/to/foo") > (use-modules (foo bar)) > > I get the same error I've got by using a module before adding the path: > > ERROR: no code for module (foo bar) > > How can I load a module if I tried loading it before adding the path? > > I'm using Guile 2.0.5. > > --e89a8ff25564a2344804d393a9ec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I guess you need to tell GUILE where to find your mo= dule before you can load it. GUILE has some standard places where it will l= ook for modules. If your module is not there, then you need to add the path= so that GUILE can find it. There are several ways to do this. One is to us= e "add-to-load-path" as you did. Another would be setting up some= environment variable so that a certain path is added. You can find more de= tailed information in the manual.=A0

Yanbin

On Fri, Jan 18= , 2013 at 9:53 AM, Diogo F. S. Ramos <diogofsr@gmail.com> w= rote:
I have a module at `/path/to/foo'.

If I open a guile REPL and type:

(add-to-load-path "/path/to/foo")
(use-modules (foo bar))

everything works. But, if I type:

(use-modules (foo bar))
(add-to-load-path "/path/to/foo")
(use-modules (foo bar))

I get the same error I've got by using a module before adding the path:=

ERROR: no code for module (foo bar)

How can I load a module if I tried loading it before adding the path?

I'm using Guile 2.0.5.


--e89a8ff25564a2344804d393a9ec--