From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Mr. Peter Ivanyi" Newsgroups: gmane.lisp.guile.user Subject: access of global variables from modules Date: Sat, 30 Mar 2002 22:43:45 +0000 Sender: guile-user-admin@gnu.org Message-ID: <3CA63FA1.5FBAC15@carme.sect.mce.hw.ac.uk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1017528379 26810 127.0.0.1 (30 Mar 2002 22:46:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 30 Mar 2002 22:46:19 +0000 (UTC) Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16rRc2-0006yJ-00 for ; Sat, 30 Mar 2002 23:46:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16rRas-00006w-00; Sat, 30 Mar 2002 17:45:06 -0500 Original-Received: from carme.sect.mce.hw.ac.uk ([137.195.68.1]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16rRa5-0008WR-00 for ; Sat, 30 Mar 2002 17:44:17 -0500 Original-Received: from carme.sect.mce.hw.ac.uk (mercury.sect.mce.hw.ac.uk [137.195.68.189]) by carme.sect.mce.hw.ac.uk (8.9.3/8.9.3/Debian/GNU) with ESMTP id WAA11013 for ; Sat, 30 Mar 2002 22:44:15 GMT X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.15-3SGI_39 i686) X-Accept-Language: en Original-To: "guile-user@gnu.org" Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:79 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:79 Hello again, I have another problem with modules. If I have a module can the module access "global" variables. I have an application, which defines some global variables. The application also loads some modules and I would like to access the global variables from the module. How can I do it ? (I think I can put the global variables into a module and another module can depend on it, but isn't there another way ?) For example I have this module (gen.scm): ---------------------- (define-module (gen gen)) (export gen-hello) (define (gen-hello) (set! *G* 3) (display "Hello World !") (newline) ) ------------------------- then I receive this ------------------------- peteri@mercury $ guile guile> (define *G* 1) guile> (use-modules (gen gen)) guile> (gen-hello) ./gen/gen.scm:7:1: In expression (set! *G* 3): ./gen/gen.scm:7:1: Unbound variable: *G* ABORT: (unbound-variable) Type "(backtrace)" to get more information or "(debug)" to enter the debugger. guile> ------------------------- instead of setting *G* to 3 and then print "Hello World !". Thanks, for your help in advance. Peter Ivanyi _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user