[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] `try-module-autoload' and `current-reader'

From: Neil Jerram
Subject: Re: [PATCH] `try-module-autoload' and `current-reader'
Date: Thu, 19 Jan 2006 00:13:54 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hi,
> In `boot-9.scm', `try-module-autoload' should be using `load-module',
> and not `primitive-load', when loading a non-compiled module.  The
> reasons are (i) non-autoloaded modules are loaded using `load-module'
> and (ii) `load-module' and `primitive-load' interact differently with
> the `current-reader' fluid.
> `load-module' uses R4RS `load' which does some framing on the value of
> `current-reader', setting it to `#f' (meaning: use the built-in `read')
> if no optional reader argument was provided.  OTOH, `primitive-load'
> doesn't change the value of `current-reader', thus resulting in a
> different behavior.

Hmm; I think just adding (with-fluids ((current-reader #f)) ...)
around the (load-file ...) call would be better.  Otherwise we would
be introducing two extra changes:

1. Starting a new stack (the start-stack form in R4RS's load).  This
   affects backtraces, and it is occasionally useful for a backtrace
   to show that module X is being loaded because of code from module

2. Interpreting a file path beginning with "." as relative to the
   current module's load filename.

What do you think?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]