This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Starting a repl within a package


Jost Boekemeier <jostobfe@aubergine.zrz.TU-Berlin.DE> writes:

> Per Bothner <per@bothner.com> writes:
> 
> > You can do it using the Kawa module system. 
> 
> Is that documented somewhere?

Well, the Kawa manual does have a chapter on the module system.
I assume you've read that.

> How do you map a set of classes onto a scheme module

That sounds backwards.  What happens is that a Scheme module (currently
a Scheme source file) is mapped (compiled to) a Java class (plus sometimes
some anonymous helper classes).  You can specify the name and package of
that class.

> and how do you start a repl in this module?

You can't.  Repl aren't "in" a module.  It's a little like asking
how to start a Java thread in a Java package - the concepts are
basically orthogonal.  A module is a static concept, and a repl is
a dyamic concept.

What you *can* do is start a repl and *import* bindings from a module.
You can do that with the require form:
        #|kawa:1|# (require <foo.bar>)
where foo/bar.class is the class file compiled from (usually) foo/bar.scm.

> Reading
> your documentation I got the impression that the scheme module system
> is not orthogonal to the java package system.

Yes and no.  The Kawa module system is implemented using Java classes.
However, it doesn't care or know about packages, expect that you can
specify which package and class name a module get compiled to, and
you use fully-qualified class names in require and other forms that
name Java classes.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]