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: Mon, 07 Oct 2002 13:09:21 -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> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034010802 17396 127.0.0.1 (7 Oct 2002 17:13:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 7 Oct 2002 17:13:22 +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 17ybRY-0004WS-00 for ; Mon, 07 Oct 2002 19:13:20 +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 17ybOc-00054H-00; Mon, 07 Oct 2002 13:10:18 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17ybNl-0004oy-00 for guile-user@gnu.org; Mon, 07 Oct 2002 13:09:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17ybNj-0004ns-00 for guile-user@gnu.org; Mon, 07 Oct 2002 13:09:24 -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 17ybNi-0004nT-00 for guile-user@gnu.org; Mon, 07 Oct 2002 13:09:22 -0400 Original-Received: (qmail 7664 invoked by uid 500); 7 Oct 2002 17:09:43 -0000 Original-To: guile-user@gnu.org In-Reply-To: <87vg4gl4g3.fsf@raven.i.defaultvalue.org> (Rob Browning's message of "Sat, 05 Oct 2002 20:51:56 -0500") Mail-Copies-To: nobody Mail-Followup-To: guile-user@gnu.org Original-Lines: 68 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:1162 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1162 Rob Browning wrote: > prj@po.cwru.edu (Paul Jarc) writes: >> - The manual says (load) will evaluate the file's contents in the >> top-level environment. Is that still true inside eval, or will it >> load into the specified environment? >> - What's the difference between load and primitive-load? > > I think that's roughly the difference. If I recall right, > primitive-load doesn't alter the current-environment and doesn't > restore it after the load, but Marius can probably clarify if I'm > mistaken. If that's right, then the documentation needs to be fixed. 1.6.0: - Scheme Procedure: load filename Load FILENAME and evaluate its contents in the top-level environment. The load paths are not searched. If the variable `%load-hook' is defined, it should be bound to a procedure that will be called before any code is loaded. See documentation for `%load-hook' later in this section. ... - Scheme Procedure: primitive-load filename - C Function: scm_primitive_load (filename) Load the file named FILENAME and evaluate its contents in the top-level environment. The load paths are not searched; FILENAME must either be a full pathname or be a pathname relative to the current directory. If the variable `%load-hook' is defined, it should be bound to a procedure that will be called before any code is loaded. See the documentation for `%load-hook' later in this section. This should also specify what load does with a relative path. It's easy enough to guess, but the fact that it's specified for primitive-load and not for load introduces doubt. >> - Is there a way to load from an already-open port rather than a >> filename? Could I just loop with read and eval? Would that handle, >> e.g., read-hash-extend properly? I don't see any reason it >> wouldn't. > > I think that should work. Ok, I'll probably do that then. >> - How do I create a new environment? The documented procedures don't >> seem to exist: > > How about this: > > $ guile > guile> (use-modules (ice-9 safe)) > guile> (define msm (make-safe-module)) ... > guile> (use-modules (ice-9 safe-r5rs)) > guile> (define msm (null-environment 5)) Thanks, that seems to work. The manual doesn't mention the need for (ice-9 safe-r5rs) in the Environments node, and make-safe-module is undocumented. >> guile> (assv-ref %guile-build-info 'guileversion) >> "1.6.0" > > or perhaps just (version) :> Yeah, that too. paul _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user