This is the mail archive of the kawa@sourceware.org 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]
Other format: [Raw text]

Fwd: Questions regarding modules


---------- 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/


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