From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.user Subject: Re: modules Date: Sun, 21 Mar 2004 15:47:17 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <871xnmntoq.fsf@ivanova.rotty.yi.org> References: <877jxeahbn.fsf@buug.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1079881319 19470 80.91.224.253 (21 Mar 2004 15:01:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 21 Mar 2004 15:01:59 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Mar 21 16:01:53 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B54SW-00008O-00 for ; Sun, 21 Mar 2004 16:01:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B54S6-0007VB-R7 for guile-user@m.gmane.org; Sun, 21 Mar 2004 10:01:26 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B54Rf-0007EV-U9 for guile-user@gnu.org; Sun, 21 Mar 2004 10:00:59 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B54R3-0006my-IS for guile-user@gnu.org; Sun, 21 Mar 2004 10:00:54 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B54Qx-0006Zu-Jk for guile-user@gnu.org; Sun, 21 Mar 2004 10:00:15 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1B54Qs-0005RL-00 for ; Sun, 21 Mar 2004 16:00:10 +0100 Original-Received: from chello212186006140.401.14.univie.teleweb.at ([212.186.6.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Mar 2004 16:00:09 +0100 Original-Received: from a.rottmann by chello212186006140.401.14.univie.teleweb.at with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Mar 2004 16:00:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: guile-user@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: chello212186006140.401.14.univie.teleweb.at User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:IvM5LYlkh6tFt0XsEznQ7kcwf8w= X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.4 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 Xref: main.gmane.org gmane.lisp.guile.user:2961 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2961 Ian Zimmerman writes: > 1/ How can I customize a module during loading? In Emacs Lisp, > I can either: > > a) set a global variable, for instance > > (setq foo-module:bar 'baz) > > prior to loading a library "foo-module". If that library itself does > > (defvar foo-module:bar) > > it picks up the value that was previously set. But in Scheme, set! only > works on variables that have already been define'd, and a define creates > a new variable totally unrelated to the existing value. > What exactly do you want to accomplish? The point of modules is to isolate mostly independent code from each other, and using a global variable would just prevent that isolation. If you need a global module setting, you can provide accessor functions: (define *bar* "The bar") (define (set-bar! val) (set! *bar* val)) (define (get-bar) *bar) Andy -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62 Make free software, not war! _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user