guile-user
[Top][All Lists]
Advanced

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

load-from-path and compile-file question


From: Ian Hulin
Subject: load-from-path and compile-file question
Date: Sun, 06 Nov 2011 19:44:55 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

Hi all,

In LilyPond initialization code, at the moment we build a list of
scheme files to load from our %load-path and interpret as we go.

I'm currently hacking some code so that if we do the load-from-path
successfully we then call
(compile-file (%search-load-path "blah.scm") <output-path>/blah.go).

However one of these file has code using (current-module) to do some
validation on some interpretive code basically looking for a
symbol-name which is defined in the current module and is a procedure.

The procedure works fine and validates as expected when the .scm file
is loaded via load-from-path, but fails validation of exactly the same
symbol when the file is being compiled using compile-file.

I investigated by putting trace commands in the file being compiled to
(format #f "~s" (current-module)) and this showed different results
between when the file was being interpreted after being loaded and
when it was compiling.

(load-from-path) showed the expected module '(lily), (compile-file)
showed an "anonymous" module with an internally generated name.

Tested with Guile V2.0.3.

Is this a bug, or are we doing something seriously screwy in our code?

Cheers,
Ian Hulin




reply via email to

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