chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Educate me please: compiling modules


From: Shaun Bruner
Subject: Re: [Chicken-users] Educate me please: compiling modules
Date: Wed, 30 Mar 2011 17:36:53 -0500



On Wed, Mar 30, 2011 at 5:08 PM, Mario Domenech Goulart <address@hidden> wrote:
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

Thanks! That did it. I had to reread the section on import libraries, but that's just the nudge I needed.

reply via email to

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