Opened 12 years ago

Closed 12 years ago

#135 closed defect (worksforme)

load & CHICKEN_INCLUDE_PATH for chicken 4

Reported by: Mario Domenech Goulart Owned by:
Priority: major Milestone:
Component: compiler Version: 4.2.x
Keywords: Cc:
Estimated difficulty:

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.

Change History (3)

comment:1 in reply to:  description Changed 12 years ago by felix winkelmann

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.

comment:2 Changed 12 years ago by felix winkelmann

I'm not sure what to do about this.

comment:3 Changed 12 years ago by felix winkelmann

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.