[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Educate me please: compiling modules
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-users] Educate me please: compiling modules |
Date: |
Wed, 30 Mar 2011 18:08:20 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) |
Hi Shaun,
On Wed, 30 Mar 2011 16:46:33 -0500 Shaun Bruner <address@hidden> wrote:
> I've only recently begun to play with Chicken's module system, and am having a
> bit of trouble figuring out how to use csc against compiled modules. I'm
> hoping
> someone on this list can show me the error of my ways. One thing that trips me
> up is that what I'm trying works while using csi. Here's a small hello world
> example I've written to illustrate.
>
> ;; hello.scm
>
> (declare (unit hello)) ; tried both with and without this line
>
> (module hello
> (say-hello-to)
> (import scheme chicken)
>
> (define (say-hello-to name)
> (string-append "Hello, " name)))
>
> ;; main.scm
>
> (load "hello")
> (import (prefix hello h:))
>
> (define (do-test)
> (display (h:say-hello-to "you!")))
>
> (define (main) (do-test))
>
> and from bash:
>
> $ csc -c hello.scm
> $ csc -c main.scm
>
> Syntax error (import): cannot import from undefined module
>
> hello
>
> Expansion history:
>
> <syntax> (##core#begin (import (prefix hello h:)))
> <syntax> (import (prefix hello h:)) <--
>
> Error: shell command terminated with non-zero exit status 17920
>
>
> I'm pretty sure the problem is me, but I've reached that point where I'm
> trying
> the same 3 or 4 things and hitting the same walls. Any help setting me
> straight
> is much appreciated.
I think all you need is -J, like
$ csc -J hello.scm
(I'm not sure if you really want -c)
Best wishes.
Mario
--
http://parenteses.org/mario