chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] How to use units and modules together?


From: Matt Welland
Subject: [Chicken-users] How to use units and modules together?
Date: Sun, 30 Apr 2017 21:18:21 -0700

Is using units and modules together supported? I'd like to use modules but don't want to have to install them as eggs. 

I have tried this:

=====main.scm=====
(declare (uses other))
(import other)

(other-print "Hello")
======end========

=====other.scm=====
(declare (unit other))

(module other
    (other-print)
  (import scheme chicken)
  (define (other-print arg)
    (print "Got: " arg)))

(import other)
======end======

Compile like this:

csc other.scm -c
csc other.o main.scm

===============
It won't let me import other:

Syntax error (import): cannot import from undefined module

other

Expansion history:

<syntax>  (##core#begin (import other))
<syntax>  (import other) <--
================
However if I comment out the (import other) I can call other-print like this:

(other#other-print "Hello")

and it works.

reply via email to

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