chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Re: let-location & modules


From: F. Wittenberger
Subject: [Chicken-users] Re: let-location & modules
Date: Thu, 09 Oct 2008 17:46:40 +0200

Am Donnerstag, den 09.10.2008, 12:07 +0200 schrieb felix winkelmann:
> On Wed, Oct 8, 2008 at 12:45 PM, Jörg F. Wittenberger
> <address@hidden> wrote:
> >
> > Yesterday I tried to convert my code to the module system.  But that
> > failed.  For the time being I managed to get along without modules.
> >
> > I've got the impression - though this is probably wrong - that I can
> > either convert everything into modules or nothing at all.
> 
> You don't have to. But if you use extensions that provide modules, you'll
> have to add the proper "import" forms.

This appears to be my problem.

I succeeded converting one file to a module.  (Attached, since I might
have been the first one to do that with libmagic and it extends the
libmagic as I found it by magic-buffer.)

But that one exports just one procedure I actually care about.  And that
one is used late at run time only.  Tested, works.

More I can hardly try, because everything else depends somehow on some
syntax.  So this syntax (srfi-34+35 my module name "cndtnhndlng") is the
only possible next candidate.  But initialisation fails in the next file
(in my case srfi-19), which happens to use srfi-34's
define-condition-type on top level.

Note that this dependant file (here srfi-19) is not yet converted to a
module.

In the dependant file I tried both (import cndtnhndlng) and
(import-for-syntax cndtnhndlng) [that is not a logical and, but OR, i.e.
all combinations].

Using "print" right before the define-condition-type on
make-condition-type and &error I found both to be an unbound value.
Always.

(BTW: I verified too, that make-condition-type works within the
cndtnhndlng module and &error is defined there).

So, should I try?

> > How do I mix modules and plain code?  I'd like to convert them one by
> > one.
> >
> 
> Just import from the modules you'd like to use (at toplevel). If you convert
> parts of your application code to modules, you have to make sure that
> the inter-dependency (import) tree of modules is acyclic. This may be
> difficult with code that lived previously in one big (global) namespace.

That mostly taken care of semiautomatically since I'm coming from a
module system, which is acyclic too.

Attachment: libmagic.scm
Description: Text Data


reply via email to

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