public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Marius Kjeldahl <marius.kjeldahl@gmail.com>
Cc: kawa@sourceware.org
Subject: Re: Questions regarding modules
Date: Mon, 03 Mar 2014 21:15:00 -0000	[thread overview]
Message-ID: <5314F102.2020600@bothner.com> (raw)
In-Reply-To: <CAHdMyCL_RtaqPdChwmJVY9bXtU6mP_Lpkv08VNZuh8r0XG9kAQ@mail.gmail.com>

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/

  reply	other threads:[~2014-03-03 21:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 15:52 Marius Kjeldahl
2014-03-01 22:30 ` Marius Kjeldahl
2014-03-01 23:06 ` Per Bothner
2014-03-03  9:06   ` Per Bothner
2014-03-03  9:23     ` Marius Kjeldahl
2014-03-03 20:30       ` Per Bothner
2014-03-03 20:50         ` Marius Kjeldahl
2014-03-03 21:15           ` Per Bothner [this message]
     [not found]             ` <CAHdMyCKEqZXfpqTL-AX5q+XAQNq3cChoYFa0aDDVet+_PX_2og@mail.gmail.com>
2014-03-03 21:42               ` Fwd: " Marius Kjeldahl
2014-03-04  9:10     ` Per Bothner
2014-03-04  9:55       ` Marius Kjeldahl
2014-03-04 17:23         ` Per Bothner
2014-03-04 18:26           ` Marius Kjeldahl
2014-03-04 18:48             ` Per Bothner
2014-03-04 18:58               ` Marius Kjeldahl
2014-03-04 20:16                 ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5314F102.2020600@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=marius.kjeldahl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).