guile-devel
[Top][All Lists]
Advanced

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

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


From: Ludovic Courtès
Subject: Re: [PATCH] `try-module-autoload' and `current-reader'
Date: Thu, 19 Jan 2006 09:42:43 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

Neil Jerram <address@hidden> writes:

> 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.

[...]

> 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
>    Y.
>
> 2. Interpreting a file path beginning with "." as relative to the
>    current module's load filename.

Change #1 would just make autoload's behavior equivalent to that of
explicit loading via `use-module'.  It seems important to me that
autoload and `use-module' behave identically, i.e., either they both use
`load-module' and incidentally set up a new stack, or none of them does.

Also, the `with-fluids' framing is already provided by R4RS `load' and
consequently by `load-module' so I think we should avoid duplicating it.

I don't understand your second point.  In `try-module-autoload', the
name of the module _to be loaded_ is passed, and its path is inferred
from that name, not relatively to the current module's path.  Am I
missing something?

Thanks,
Ludovic.




reply via email to

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