chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] csc, modules, (require), (import)


From: felix winkelmann
Subject: Re: [Chicken-users] csc, modules, (require), (import)
Date: Wed, 10 May 2006 07:39:59 +0200

On 5/9/06, Dan <address@hidden> wrote:
Hi, a few more things I find unexplainable below;
again, the source files are

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

1) mv mod1.so /tmp
./x
Error: (module) during expansion of (module ...) -
modules are not supported

        Call history:

        require                 <--

require (and it's family) will find the mod1.scm instead and
will try to eval it (with the default low-level/non-syntax-case
expander).


2) # with mod1.so in current dir
mv mod1.scm /tmp
csi x.scm

; loading /opt/chicken/lib/chicken/syntax-case.so ...
; loading
/opt/chicken/lib/chicken/syntax-case-chicken-macros.scm
...
; loading x.scm ...
; loading ./mod1.so ...
; visiting mod1.so ...
Error: illegal character in line 5: #\{

import needs source code to figure out syntax-definitiions,
so it'll need mod1.scm somewhere in your include path,
or in the repository.


3) # with mod1.so, mod1.scm in current dir
csi
#;1> (require 'mod1)
; loading ./mod1.so ...
#;2> (import mod1)
; visiting mod1.scm ...

Why is the source "visited" if the .so library is
available?

To extract syntax and module definitions, which are not compiled
into the .so.


cheers,
felix




reply via email to

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