From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.user Subject: Re: loading a module via an absolute path Date: Fri, 18 Oct 2002 19:26:02 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-user-admin@gnu.org Message-ID: References: <87vg4gl4g3.fsf@raven.i.defaultvalue.org> <87adlb1iz4.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034983725 14129 80.91.224.249 (18 Oct 2002 23:28:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 18 Oct 2002 23:28:45 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 182gXp-0003fV-00 for ; Sat, 19 Oct 2002 01:28:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 182gWa-0005ef-00; Fri, 18 Oct 2002 19:27:24 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 182gVL-0005FH-00 for guile-user@gnu.org; Fri, 18 Oct 2002 19:26:07 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 182gVH-0005CQ-00 for guile-user@gnu.org; Fri, 18 Oct 2002 19:26:05 -0400 Original-Received: from multivac.student.cwru.edu ([129.22.96.25] helo=multivac.cwru.edu) by monty-python.gnu.org with smtp (Exim 4.10) id 182gVG-0005C8-00 for guile-user@gnu.org; Fri, 18 Oct 2002 19:26:03 -0400 Original-Received: (qmail 15885 invoked by uid 500); 18 Oct 2002 23:26:24 -0000 Original-To: guile-user@gnu.org In-Reply-To: <87adlb1iz4.fsf@zagadka.ping.de> (Marius Vollmer's message of "19 Oct 2002 00:26:55 +0200") Mail-Copies-To: nobody Mail-Followup-To: guile-user@gnu.org Original-Lines: 29 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 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:1211 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1211 Marius Vollmer wrote: > prj@po.cwru.edu (Paul Jarc) writes: >> Is there any chance of extending use-modules (or providing a >> cooperating procedure) to allow things like: >> >> (use-modules ("/path/to/foo.scm" :select ...)) > > Could you use the this? > > (load "/path/to/foo.scm") > (use-modules (NAME :select ...)) That's not quite what I'm looking for. The way I did it, I don't use define-module at all; the imported code doesn't know or care what name the importing code uses to refer to it. The loader procedure takes care of creating a new (anonymous) module, and loads the code into it. The importing code gets a reference to the module containing the imported code, and binds that value to a normal variable, and uses module-ref to fetch things it wants. It's much like dlopen and dlsym (not that I'm more than slightly familiar with them). I'd be happy to keep using my loader, except that the modules it creates (with make-safe-module) are too sparse - lacking useful things like, say, defined?. OTOH, a library loaded by use-modules has all the normal bindings at its disposal. How can I create a module like that? paul _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user