[Top][All Lists]

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

[Chicken-users] Confused by modules

From: Mark Carter
Subject: [Chicken-users] Confused by modules
Date: Wed, 15 Aug 2018 11:11:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Chicken scheme has modules, extensions, units, eggs, etc., and I'm confused as to how it all works.

I have written a module mcutils.scm, containing:

 (export define-syntax-rule displayln
     file->lines hello-utils until)
 (import chicken extras scheme)


;;; a proc calling read-line



The calling program, vas-parser.scm, contains the lines:

(include "mcutils.scm")
(use mcutils)

When I execute

csi vas-parser.scm

it all works fine.

I can compile successfully using

csc vas-parser.scm

but when I try to run vas-parser, it says that there is an unbound variable read-line; which is in unit extras, I believe.

I think that's because the interpreter loads the extras unit automatically, but the compiler doesn't??

But my module says to import extras, so why doesn't it work?

I must admit, I'm a bit baffled about what distinguishes include/import/use/require-extension and when to use what under which circumstances.

reply via email to

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