[Top][All Lists]

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

Re: [Chicken-users] cannot import from undefined module

From: Peter Bex
Subject: Re: [Chicken-users] cannot import from undefined module
Date: Wed, 7 Mar 2012 14:08:31 +0100
User-agent: Mutt/

On Wed, Mar 07, 2012 at 01:03:41PM +0000, Mark Carter wrote:
> If I try to import srfi-6 in my module, like so:
> (module 
>  mccsl ( define-simple-syntax)
>  (import scheme chicken)
>  (import srfi-6)
>   ...
> )
> I get the compilation error
> Syntax error (import): cannot import from undefined module

That's because (import ...) only loads the import library.
Chicken is a compiler which uses separate compilation, which means we
also support cross-compilation. To get all this to work properly,
the import libraries are separated from the actual libraries.

The import library only contains macro stuff and information about
available symbols.

To load the library itself, you should use the USE clause:

(module mccsl (define-simple-syntax)
  (import chicken scheme)
  (use srfi-6)

> What do I do to fix this? It's all proving to be an uphill battle.

We'd appreciate if you could provide hints about how to improve the
documentation.  This is often a problem for newbies, so we should really
try and fix this.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

reply via email to

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