chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] compiling with a precompiled module


From: Felix
Subject: Re: [Chicken-users] compiling with a precompiled module
Date: Mon, 19 Jul 2010 15:13:39 +0200 (CEST)

From: Martin DeMello <address@hidden>
Subject: [Chicken-users] compiling with a precompiled module
Date: Mon, 19 Jul 2010 00:26:37 +0530

> I have some scheme code that I want to wrap in a module and then use
> as a shared library.
> 
> $ cat body.scm
> (define (hello)
>   (print "hello world"))
> 
> $ cat outer.scm
> (module foo *
>   (import chicken)
>   (import scheme)
>   (include "body"))
> 
> $ csc -s outer.scm
> 
> $ cat test.scm
> (load "outer.so")
> (import foo)
> 
> (hello)
> 
> $ csi -s test.scm
> hello world
> 
> So far so good. But now, how do I compile test.scm? I've not been able
> to find the magical compiler incantation, and everything I could find
> on the wiki just talks about the interpreter.

To compile "test.scm", the compiler needs something to figure out
what "(import foo)" means. This ting is called the "import library"
and is produced by passing "-j <modulename>" or "-J" when compiling
the module:

  csc -sJ outer.scm

I'll check whether that can be documented in a clearer manner.


cheers,
felix



reply via email to

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