On 5/9/06, Dan <[EMAIL PROTECTED]> wrote:
Hi all,

(repl) in a compiled file doesn't seem to know about
variables or functions imported from modules. Is this
normal? How can I work around this?

;; mod1.scm
(module mod1 (f1)
  (define (f1 x) x))

;; x.scm
(require 'mod1) (import mod1)
(display f1) (newline)
(define (f2 x) x)
(repl)

csc -R syntax-case -sv mod1.scm
csc -R syntax-case -v x.scm

% ./x
#<procedure (mod1$$f1 g14861487)>
#;> f2
#<procedure (f2 g14871488)>
#;> f1
Error: unbound variable: f1
#;>


The repl still uses the low-level macro system.
Entering "(require-extension syntax-case)" and
"(import mod1)" in the repl should work.

(you can also say "(require 'syntax-case)" in x.scm,
which will load the syntax-case extension at run-time,
sth like "(eval '(import mod1))" will make it available
right away in any subsequently eval'd code, like from
the repl).


(felix)



cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to