chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Confused by modules


From: Christian Kellermann
Subject: Re: [Chicken-users] Confused by modules
Date: Wed, 15 Aug 2018 17:25:05 +0200
User-agent: Mutt/1.9.1 (2017-09-22)

Hi Mark!

* Mark Carter <address@hidden> [180815 12:11]:
> Chicken scheme has modules, extensions, units, eggs, etc., and I'm confused
> as to how it all works.

Oh yes, we promise that it will get easier in CHICKEN 5!

> I have written a module mcutils.scm, containing:
> 
> 
> (module
>  mcutils
>  (export define-syntax-rule displayln
>      file->lines hello-utils until)
>  (import chicken extras scheme)

You need to (use extras).
Import in CHICKEN 4 only extends the namespace but does not do any
code loading.  That's what use is for.

Units are traditional compiler units, better forget this term now.
Extensions are packaged modules and there may be more than one
module in an extension. That's what we call 'eggs'.

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

use and require-extension are the same. Import will expand the
namespace, which is needed for syntax modules like 'chicken' or
'scheme'.  Include works like a C #include as it textually inserts
the mentioned file.

Does this help?

Kind regards,

Christian

-- 
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

Attachment: signature.asc
Description: PGP signature


reply via email to

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