Summary

load & CHICKEN_INCLUDE_PATH for chicken 4

Metadata

Description

Maybe I'm terribly missing something, but...

Consider the following scenario:

 $ ls -l ~/tmp/foo
 total 8
 -rw-r--r-- 1 mario mario 14 Nov 30 14:57 foo3.scm
 -rw-r--r-- 1 mario mario 47 Nov 30 14:23 foo4.scm



 $ cat ~/tmp/foo/foo3.scm
 (define a 3)



 $ cat ~/tmp/foo/foo4.scm
 (module foo4 *
  (import scheme)
  (define a 5)
 )

Chicken 3 ==

 $ pwd
 /home/mario



 $ CHICKEN_INCLUDE_PATH=~/tmp/foo csi -nq
 #;1> (use foo3)
 ; loading /home/mario/tmp/foo/foo3.scm ...
 #;2> a
 3

Chicken 4 ==

 $ pwd
 /home/mario



 $ CHICKEN_INCLUDE_PATH=~/tmp/foo csi -nq
 #;1> (use foo4)
 
 Error: (import) during expansion of (import ...) - cannot import from undefined module: foo4
 #;1> (load "foo4.scm")
 ; loading foo4.scm ...
 
 Error: (open-input-file) cannot open file - No such file or directory: "foo4.scm"
 #;1> (load "/home/mario/tmp/foo/foo4.scm")
 ; loading /home/mario/tmp/foo/foo4.scm ...
 ; loading /usr/local/chicken-4.2.10/lib/chicken/4/scheme.import.so ...
 #;2> (import foo4)
 #;3> a
 5

I see chicken 3 prints

 ; loading /home/mario/tmp/foo/foo3.scm ...

and chicken 4 prints

 ; loading foo4.scm ...

Maybe that's something.

Changes and comments

[2009-12-01 13:02:50 UTC] felix wrote:

Replying to mario:

> == Chicken 3 == >... > == Chicken 4 == >... > Error: (import) during expansion of (import ...) - cannot import from undefined module: foo4

Import-libraries are not loaded from the include-path, when `require-extension` or `use` is used: these always load from the egg-repo. `require` (IIRC, this confuses me, too) respects the include path, since it is basically a "load-once" operation.

> #;1> (load "foo4.scm") > ; loading foo4.scm ... > > Error: (open-input-file) cannot open file - No such file or directory: "foo4.scm"

`load` does never respect the include path, it is the lowest-level loading mechanism.

[2009-12-01 13:03:19 UTC] felix wrote:

I'm not sure what to do about this.

[2009-12-10 07:46:56 UTC] felix changed status from new to closed

[2009-12-10 07:46:56 UTC] felix set resolution to worksforme