This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Fwd: Questions regarding modules
- From: Marius Kjeldahl <marius dot kjeldahl at gmail dot com>
- To: kawa at sourceware dot org
- Date: Mon, 3 Mar 2014 22:42:16 +0100
- Subject: Fwd: Questions regarding modules
- Authentication-results: sourceware.org; auth=none
- References: <CAHdMyCJYL=6YJ0oT1pbLdA57kGRCXMRVM1QxyfWar0pzErYsrw at mail dot gmail dot com> <531267B8 dot 6040407 at bothner dot com> <53144610 dot 9040207 at bothner dot com> <CAHdMyCJYH4AnZJS8pKxJ+YOo51DJBOw9a6rJQqwVYv-LxTjPsQ at mail dot gmail dot com> <5314E655 dot 7090809 at bothner dot com> <CAHdMyCL_RtaqPdChwmJVY9bXtU6mP_Lpkv08VNZuh8r0XG9kAQ at mail dot gmail dot com> <5314F102 dot 2020600 at bothner dot com> <CAHdMyCKEqZXfpqTL-AX5q+XAQNq3cChoYFa0aDDVet+_PX_2og at mail dot gmail dot com>
---------- Forwarded message ----------
From: Marius Kjeldahl <marius.kjeldahl@gmail.com>
Date: Mon, Mar 3, 2014 at 10:42 PM
Subject: Re: Questions regarding modules
To: Per Bothner <per@bothner.com>
Ah, thanks for confirming my issues; I was starting to go insane over
why I couldn't get it working.
The import rename makes me feel dirty, but will definitively work for
now. The module stuff should probably be fixed eventually (give me
enough time and keep answering my questions... ;-).
Thanks,
Marius K.
On Mon, Mar 3, 2014 at 10:15 PM, Per Bothner <per@bothner.com> wrote:
> On 03/03/2014 12:50 PM, Marius Kjeldahl wrote:
>>
>> For good reasons I need to control where
>> the exported symbols appear when requiring the module, not when
>> defining the individual methods, which is why simply importing all the
>> defines doesn't cut it.
>
>
> In that case I suggest using import with either rename or prefix.
> For example:
> (import (prefix (net kjeldahl kawatest app HelloKawa) kawa-utils-))
> ...
> (kawa-utils-hello)
>
>
>> That's why I'm trying to put it into a class
>> (I really want a namespace, but who cares).
>
>
> As I see it, a module *is* a namespace.
>
>
>> However, the docs you've written under the section "How a module
>> becomes a class" states that using module-name is an alternative to
>> define-class, and THIS is what I am struggling to get working.
>>
>> Without resorting to using define-class in HelloKawa.scm, I am not
>> able to use (net.kjeldahl.kawatest.app.HelloKawa:hello) at all. If
>> possible, could you show me how I can define the "class" in
>> HelloKawa.scm with module-name and defining the hello method in it so
>> that it would be callable with the full name
>> net.kjeldahl.kawatest.app.HelloKawa:hello from KawaActivity?
>
>
> Doesn't seem to be working for me either. But since it's sort-of
> a backdoor part the module system, that may be ok. Still, I'd like to
> understand why it isn't working.
>
>
>> I would be perfectly happy to be told that define-class IS what I need
>> to use, but based on how I understand the docs, kawa offers a "less
>> javalike" method of defining "javalike" classes, and that is what I'm
>> trying to figure out.
>
>
> Using import seems to make sense. Though import does need some tweaks
> - it should probably be extended to support a source filename, as in
> require.
>
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/